• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ draw_frame函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中draw_frame函数的典型用法代码示例。如果您正苦于以下问题:C++ draw_frame函数的具体用法?C++ draw_frame怎么用?C++ draw_frame使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了draw_frame函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch

/*!
	@brief 描画プロシージャ
*/
void mine_tile::paint(Graphics* g){
	switch(state){
	case init:
	case init_lock:
		draw_frame(g);
		break;
	case opened:
		draw_grid(g);
		draw_number(g);
		break;
	case marked:
	case mark_lock:
		draw_frame(g);
		draw_flag(g);
		break;
	case bomb:
		draw_grid(g);
		draw_bomb(g);
		break;
	case exploded:
		draw_grid(g);
		draw_bomb(g);
		draw_cross(g);
		break;
	case missmark:
		draw_frame(g);
		draw_flag(g);
		draw_cross(g);
		break;
	default:
		break;
	}
}
开发者ID:ShotaroTsuji,项目名称:mona,代码行数:36,代码来源:tile.cpp


示例2: draw_frame

void gui_el_t6::draw_d(float _dx, float _dy, int8_t plane)
{
    int32_t pl = 1;
    float xx = -w * sx + _dx;

    if (intg > 0)
    {
        for (int8_t i=0; i<intg; i++)
        {
            if (vard < 0 && pl > abs(vard) && i == (intg-1))
            {
                draw_frame(11, xx, _dy, plane);
            }
            else
            {
                int32_t cf = abs(vard / pl) % 10;
                draw_frame(cf, xx, _dy, plane);
                pl *= 10;
                xx -= (w + dw) * sx;
            }
        }
    }
    else
    {
        while ( pl <= abs(vard) || pl == 1)
        {
            int32_t cf = abs(vard / pl) % 10;
            draw_frame(cf, xx, _dy, plane);
            pl *= 10;
            xx -= (w + dw) * sx;
        }
        if (vard < 0)
            draw_frame(11, xx, _dy, plane);
    }
}
开发者ID:Marisa-Chan,项目名称:OpenSoku,代码行数:35,代码来源:gui.cpp


示例3: life

void life(void){

	char led;

	while(1){
		int f, frame_number;
		frame_number = 0;
		
		initialize_frame_log();
		
		//fade to all-on LED grid
		for ( led=0; led<=19; led++ ) { led_grid_next[led] = 100; }
		fade_to_next_frame();
		for( f=0 ; f<300 ; f++ ){ draw_frame(); } //display this frame for awhile
		
		//fade to random start frame
		set_random_next_frame();
		fade_to_next_frame();
		
		while(1){
			
			if( frame_number==0 ){ log_current_frame(); } //log every 20th frame, compare future frames against it to check for oscillators
			
			for( f=0 ; f<300 ; f++ ){
				draw_frame();
			}
			
			generate_next_generation();			
			
			if( current_equals_next() == 1 ){
				//next generated frame is the same as the current frame... "still life" achieved
				for( f=0 ; f<1500 ; f++ ){ draw_frame(); } //stay on frame for awhile
				break; //exit this loop & start over
			}
			//next frame is not the same as the last
			
			if( next_equals_logged_frame() == 1 ){
				//next frame matches one we've had before, we have a repeating pattern
				//show the next frame
				fade_to_next_frame();
				for( f=0 ; f<300 ; f++ ){ draw_frame(); }
				break; //exit this loop & start over
			}
			
			fade_to_next_frame();
			frame_number++;
			if( frame_number==20 ){ frame_number = 0; }
			
			if( current_living_cells() == 0 ){
				for( f=0 ; f<1500 ; f++ ){ draw_frame(); } //stay on dead frame for awhile
				break; //all cells dead, exit this loop & start over
			}
			
		}
		
		
	}

}
开发者ID:benbrandt22,项目名称:TinyLife5,代码行数:59,代码来源:TinyLife5.c


示例4: tick

int tick() {
    // Handle user input
    Direction in = get_direction();
    if (in != NO_DIRECTION) {
        push_move(move_list, in);
    }
    
    // Handle snake movement
    update_direction(snake, move_list);
    move_snake(snake);

    // Draw everything
    draw_frame(snake, food_list);

    Collision collision = find_collision(snake, food_list, screen);
    switch(collision){
        case SNAKE:
        case SCREEN:
            return 0;
        
        case FOOD:
            grow_snake();
            new_food();
            break;

        case NONE:
            break;
    }
    
    snake_sleep();
    return 1;
}
开发者ID:Touzen,项目名称:snake,代码行数:32,代码来源:main.c


示例5: redraw_wwin

static void redraw_wwin(WWindow *wwin)
{
	if(WTHING_IS(wwin, WFrame))
		draw_frame((WFrame*)wwin, FALSE);
	else if(WTHING_IS(wwin, WInput))
		input_draw((WInput*)wwin, FALSE);
}
开发者ID:apenwarr,项目名称:ion1,代码行数:7,代码来源:event.c


示例6: print_help_window

/* prints help window */
void print_help_window(void)
{
	draw_frame(HELP_X,HELP_Y,HELP_WIDTH,HELP_HEIGHT,14);
	print2screen(HELP_X+((HELP_WIDTH-4)>>1),HELP_Y+1,11,"HELP");
	print2screen(HELP_X+3,HELP_Y+3,10,"ARROWS");
	print2screen(HELP_X+12,HELP_Y+3,7,"move");
	print2screen(HELP_X+3,HELP_Y+4,10,"F1,O");
	print2screen(HELP_X+12,HELP_Y+4,7,"toggle online help");
	print2screen(HELP_X+3,HELP_Y+5,10,"Q");
	print2screen(HELP_X+12,HELP_Y+5,7,"quit and save");
	print2screen(HELP_X+3,HELP_Y+6,10,"ENTER");
	print2screen(HELP_X+12,HELP_Y+6,7,"switch command/drawing mode");
	print2screen(HELP_X+3,HELP_Y+7,10,"[");
	print2screen(HELP_X+12,HELP_Y+7,7,"copy previous position into actual");
	print2screen(HELP_X+3,HELP_Y+8,10,"]");
	print2screen(HELP_X+12,HELP_Y+8,7,"copy next position into actual");
	print2screen(HELP_X+3,HELP_Y+9,10,"+");
	print2screen(HELP_X+12,HELP_Y+9,7,"increase position");
	print2screen(HELP_X+3,HELP_Y+10,10,"-");
	print2screen(HELP_X+12,HELP_Y+10,7,"decrease position");
	print2screen(HELP_X+3,HELP_Y+11,10,",");
	print2screen(HELP_X+12,HELP_Y+11,7,"shift actual position left");
	print2screen(HELP_X+3,HELP_Y+12,10,".");
	print2screen(HELP_X+12,HELP_Y+12,7,"shift actual position right");
	print2screen(HELP_X+3,HELP_Y+13,10,"G");
	print2screen(HELP_X+12,HELP_Y+13,7,"start animation");
	print2screen(HELP_X+3,HELP_Y+14,10,"H");
	print2screen(HELP_X+12,HELP_Y+14,7,"stop animation");
	print2screen(HELP_X+3,HELP_Y+15,10,"TAB");
	print2screen(HELP_X+12,HELP_Y+15,7,"toggle help");
}
开发者ID:BromIDE,项目名称:0verkill,代码行数:32,代码来源:avihelp.c


示例7: flags

void Fl_Input_Browser::draw()
{
    Fl_Flags f = flags();
    if (!active_r()) f.set(FL_INACTIVE);
    //minw_ = w();
    if (damage()&FL_DAMAGE_ALL) draw_frame();
    int X = 0, Y = 0, W = w(), H = h(); box()->inset(X, Y, W, H);
    int W1 = H*4/5;
    if (damage()&(FL_DAMAGE_ALL|FL_DAMAGE_CHILD)) {
        input()->resize(X, Y, W-W1, H);
        input()->set_damage(FL_DAMAGE_ALL);
        input()->copy_style(style()); // force it to use this style
        input()->box(FL_FLAT_BOX);

        // fix for relative coordinates
        fl_push_matrix();
        fl_translate(X,Y);

        input()->draw();

        fl_pop_matrix();
        input()->set_damage(0);
    }
    if(damage()&(FL_DAMAGE_ALL|FL_DAMAGE_VALUE|FL_DAMAGE_HIGHLIGHT))
    {
        if(over_now) f.set(FL_HIGHLIGHT);
        X += W-W1;
        W = W1;
	button_box(FL_DIV_UP_BOX);
        // draw the little mark at the right:
        draw_glyph(FL_GLYPH_DOWN_BUTTON, X, Y, W, H, f);
        over_last = over_now;
    }
}
开发者ID:edeproject,项目名称:efltk,代码行数:34,代码来源:Fl_Input_Browser.cpp


示例8: end_frame

static int end_frame(AVFilterLink *inlink)
{
    AVFilterContext *ctx = inlink->dst;
    AlphaMergeContext *merge = ctx->priv;

    int is_alpha = (inlink == ctx->inputs[1]);
    struct FFBufQueue *queue =
        (is_alpha ? &merge->queue_alpha : &merge->queue_main);
    ff_bufqueue_add(ctx, queue, inlink->cur_buf);
    inlink->cur_buf = NULL;

    while (1) {
        AVFilterBufferRef *main_buf, *alpha_buf;

        if (!ff_bufqueue_peek(&merge->queue_main, 0) ||
            !ff_bufqueue_peek(&merge->queue_alpha, 0)) break;

        main_buf = ff_bufqueue_get(&merge->queue_main);
        alpha_buf = ff_bufqueue_get(&merge->queue_alpha);

        ctx->outputs[0]->out_buf = main_buf;
        ff_start_frame(ctx->outputs[0], avfilter_ref_buffer(main_buf, ~0));
        merge->frame_requested = 0;
        draw_frame(ctx, main_buf, alpha_buf);
        ff_end_frame(ctx->outputs[0]);
        avfilter_unref_buffer(alpha_buf);
    }
    return 0;
}
开发者ID:Brhett,项目名称:FFmpeg,代码行数:29,代码来源:vf_alphamerge.c


示例9: draw_guard_frame

void
draw_guard_frame (ALLEGRO_BITMAP *bitmap, struct anim *g, enum vm vm)
{
    struct coord c;

    if (! is_guard (g)) return;
    if (g->invisible) return;

    struct frame f = g->f;
    struct frame_offset xf = g->xf;

    f.b = apply_guard_palette (f.b, g->type, g->style, vm);
    xf.b = apply_guard_palette (xf.b, g->type, g->style, vm);

    draw_xframe (bitmap, &f, &xf);
    draw_frame (bitmap, &f);

    if (g->splash && g->type != SKELETON) {
        ALLEGRO_BITMAP *splash = (g->type == SHADOW) ? v_kid_splash : guard_splash;
        palette pal = get_guard_palette (g->style, vm);
        splash = apply_palette (splash, pal);
        if (hgc) splash = apply_palette (splash, hgc_palette);
        draw_bitmapc (splash, bitmap, splash_coord (&g->f, &c), g->f.flip);
    }
}
开发者ID:allisson128,项目名称:mininim,代码行数:25,代码来源:guard.c


示例10: print_table

void print_table( int page ) {
	int x1, y1, x2, y2;
	calculate_page_frame( &x1, &y1, &x2, &y2 );
	draw_frame( x1, y1, x2, y2 );
	lower_limit = y2;
	print_page( page, char_per_row( ) * char_per_col( ) );
}
开发者ID:MegaGod,项目名称:TW,代码行数:7,代码来源:FED.C


示例11: filter_frame

static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
{
    AVFilterContext *ctx = inlink->dst;
    AlphaMergeContext *merge = ctx->priv;

    int ret = 0;
    int is_alpha = (inlink == ctx->inputs[1]);
    struct FFBufQueue *queue =
        (is_alpha ? &merge->queue_alpha : &merge->queue_main);
    ff_bufqueue_add(ctx, queue, buf);

    do {
        AVFrame *main_buf, *alpha_buf;

        if (!ff_bufqueue_peek(&merge->queue_main, 0) ||
            !ff_bufqueue_peek(&merge->queue_alpha, 0)) break;

        main_buf = ff_bufqueue_get(&merge->queue_main);
        alpha_buf = ff_bufqueue_get(&merge->queue_alpha);

        merge->frame_requested = 0;
        draw_frame(ctx, main_buf, alpha_buf);
        ret = ff_filter_frame(ctx->outputs[0], main_buf);
        av_frame_free(&alpha_buf);
    } while (ret >= 0);
    return ret;
}
开发者ID:18565773346,项目名称:android-h264-decoder,代码行数:27,代码来源:vf_alphamerge.c


示例12: damage

void Flcc_ValueBox::draw()
{
    int d = damage();
    int x1 = 0; int y1 = 0; int w1 = w(); int h1 = h();

    box()->inset(x1,y1,w1,h1);

    Fl_Color_Chooser* c = (Fl_Color_Chooser*)parent();
    c->hsv2rgb(c->hue(), c->saturation(), 1.0f, tr, tg, tb);

    if(d & FL_DAMAGE_ALL) {
        draw_frame();
        generate();     
    }

    if (d == FL_DAMAGE_VALUE) fl_push_clip(x1,y1+py,w1,6);
    bg->draw(x1,y1,w1,h1);
    if (d == FL_DAMAGE_VALUE) fl_pop_clip();

    int Y = int((1-c->v()) * (h1-6));
    if (Y < 0) Y = 0; else if (Y > h1-6) Y = h1-6;
    button_box()->draw(x1, y1+Y, w1, 6, color(), 0);

    py = Y;
}
开发者ID:GustavoMOG,项目名称:efltk,代码行数:25,代码来源:Fl_Color_Chooser.cpp


示例13: draw_frame

void Flcc_HueBox::draw()
{
    if (damage() & FL_DAMAGE_ALL) {
        draw_frame();
    }

    int x1 = 0; int y1 = 0; int w1 = w(); int h1 = h();
    box()->inset(x1,y1,w1,h1);

    if (damage() == FL_DAMAGE_VALUE) fl_push_clip(x1+px,y1+py,BUTTON_SIZE,BUTTON_SIZE);
    if(bg) bg->draw(x1,y1,w1,h1);
    if (damage() == FL_DAMAGE_VALUE) fl_pop_clip();

    Fl_Color_Chooser* c = (Fl_Color_Chooser*)parent();

#ifdef CIRCLE
    int X = int(.5f*(cos(c->hue()*float(M_PI/3.0))*c->saturation()+1) * (w1-BUTTON_SIZE));
    int Y = int(.5f*(1-sin(c->hue()*float(M_PI/3.0))*c->saturation()) * (h1-BUTTON_SIZE));
#else
    int X = int(c->hue()/6.0f*(w1-BUTTON_SIZE));
    int Y = int((1-c->saturation())*(h1-BUTTON_SIZE));
#endif

    if (X < 0) X = 0; else if (X > w1-BUTTON_SIZE) X = w1-BUTTON_SIZE;
    if (Y < 0) Y = 0; else if (Y > h1-BUTTON_SIZE) Y = h1-BUTTON_SIZE;

    button_box()->draw(x1+X, y1+Y, BUTTON_SIZE, BUTTON_SIZE, button_color(), 0);
    px = X;
    py = Y;
}
开发者ID:GustavoMOG,项目名称:efltk,代码行数:30,代码来源:Fl_Color_Chooser.cpp


示例14: draw_frame

void Fl_Popup_ListView::draw() {
    draw_frame();
    if((damage() & ~FL_DAMAGE_CHILD))
        draw_child(*m_listView);
    else
        update_child(*m_listView);
    //Fl_Popup_Window::draw();
}
开发者ID:GustavoMOG,项目名称:efltk,代码行数:8,代码来源:Fl_Combo_Box.cpp


示例15: draw

    void draw() {
        if(!(damage()&FL_DAMAGE_ALL)) return;

        int X=0,Y=0,W=w(),H=h();
        box()->inset(X,Y,W,H);

        if(image()) {
            draw_frame();
            fl_push_clip(X,Y,W,H);

            Fl_Image *im = image();

            W=im->width();
            H=im->height();
            int pbw = w() - 10;
            int pbh = h() - 10;
            if(W > pbw || H > pbh) {
                W = pbw;
                H = W * im->height() / im->width();
                if(H > pbh) {
                    H = pbh;
                    W = H * im->width() / im->height();
                }
            }
            X=(w()/2)-W/2;
            Y=(h()/2)-H/2;
            if(X<5) X=5;
            if(Y<5) Y=5;

            im->mask_type(MASK_NONE);
            im->draw(X,Y,W,H,FL_ALIGN_SCALE);

            fl_clip_out(X,Y,W,H);

            X=0,Y=0,W=w(),H=h();
            box()->inset(X,Y,W,H);

            fl_color(color());
            fl_rectf(X,Y,W,H);

            fl_pop_clip();

        } else {

            draw_box();

            if(w()<=120) label_size(8);
            if(w()>120) label_size(10);
            if(w()>180) label_size(12);
            if(w()>250) label_size(14);

            if(label()[0]=='?'&&label()[1]=='\0') label_size(100);

            draw_label(X, Y, W, H, align());
        }
    }
开发者ID:edeproject,项目名称:svn,代码行数:56,代码来源:Fl_File_Dialog.cpp


示例16: draw_map

void draw_map (int map[]) {
  int i = 0;

  for (tiley = 0; tiley < scrollbmp->h; tiley += TILEH) {
    for (tilex = 0; tilex < scrollbmp->w; tilex += TILEW) {
      draw_frame (tilesbmp, scrollbmp, tilex, tiley, TILEW, TILEH, 0, 0,
                  COLS, map[i++]);
    }
  }
}
开发者ID:misfit,项目名称:dragonfighter,代码行数:10,代码来源:maphand.c


示例17: draw_world

/**
* Use first to init the world and place the apple
*/
void draw_world(SDL_Surface *s, char world[SCREEN_X_SIZE][SCREEN_Y_SIZE][4])
{
    int x, y;
    for(x = 0; x < SCREEN_X_SIZE; x++)
    {
	for(y = 0; y < SCREEN_Y_SIZE; y++)
	    draw_frame(s, x, y, background);
    }
    place_apple(s); 
}
开发者ID:elekmad,项目名称:snake,代码行数:13,代码来源:main.c


示例18: draw_mouse_frame

void
draw_mouse_frame (ALLEGRO_BITMAP *bitmap, struct anim *m, enum vm vm)
{
  if (m->invisible) return;
  struct frame f = m->f;
  palette pal = get_palette (vm);
  f.b = apply_palette (f.b, pal);
  if (hgc) f.b = apply_palette (f.b, hgc_palette);
  draw_frame (bitmap, &f);
}
开发者ID:NoSuchProcess,项目名称:mininim,代码行数:10,代码来源:mouse.c


示例19: draw_reset

void draw_reset(void) 
{
    clear_screen();
    draw_frame(); 
    draw_keymap();
    draw_street();
    draw_walk(RED);
    draw_lights();
    hide_cursor();
}
开发者ID:bear24rw,项目名称:EECE6017,代码行数:10,代码来源:draw.c


示例20: x_and_o

void x_and_o(struct visual_params *arg) {
    char f1[4][4] = {
        {1,0,0,1},
        {0,1,1,0},
        {0,1,1,0},
        {1,0,0,1}
    };
    char f2[4][4] = {
        {0,4,4,0},
        {4,0,0,4},
        {4,0,0,4},
        {0,4,4,0}
    };
    if ((arg->iterations % 2) == 0) {
        draw_frame(arg, f1, arg->energy);
    } else {
        draw_frame(arg, f2, arg->energy);
    }
}
开发者ID:karshan,项目名称:rgb_music,代码行数:19,代码来源:visuals.c



注:本文中的draw_frame函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ draw_grid函数代码示例发布时间:2022-05-30
下一篇:
C++ draw_flush函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap