您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vsync函数代码示例

51自学网 2021-06-03 09:49:26
  C++
这篇教程C++ vsync函数代码示例写得很实用,希望能帮到您。

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

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

示例1: show_picture

void show_picture(u8 image,u8 dir,u8 fade){	static u8 i,j;	if(fade)	{		for(i=0;i<4;++i)		{			pal_bright(dir?BRIGHT_MID+i:BRIGHT_MID-i);			for(j=0;j<4;++j) vsync();		}	}	draw_image(0,0,image);	pal_select(image);	swap_screen();	if(fade)	{		for(i=0;i<4;++i)		{			pal_bright(dir?BRIGHT_MAX-i:BRIGHT_MIN+i);			for(j=0;j<4;++j) vsync();		}	}}
开发者ID:VWarlock,项目名称:zx-evo,代码行数:26,


示例2: DrawIntro

void DrawIntro(){	unsigned char frame;		ResetVideo();	setupFont();		vsync();	set_color(1, 0);	SetFontColors(14, 0, 0, 0);	put_string("KORDAMP PRESENTS", 12, 14);	for(frame = 0; frame < 7; frame ++)	{		SetFontColors(14, 0, RGB(frame, frame, frame), 0);		vsync(3);	}		frame = 5;	while(frame)		frame --;		for(frame = 7; frame > 0; frame --)	{		SetFontColors(14, 0, RGB(frame, frame, frame), 0);		vsync(3);	}}
开发者ID:ArtemioUrbina,项目名称:240pTestSuite,代码行数:27,


示例3: vsync

	void WGLWindow::multiSampling(MultiSampling::Type samplingType)	{		// No change		if (samplingType == pMultiSampling)			return;		// Not supported (also means it could not have been activated before)		if (not ::glewIsSupported("GL_ARB_multisample") or			not ::wglewIsSupported("WGL_ARB_multisample"))			return;		// Store the old vsync because we will lose it otherwise		bool hasVsync = vsync();		// Try to change the FSAA by klling the window and creating it again with the new values		closeWindowForReinit();		pMultiSampling = samplingType;		if (!initWindow())			// Init window will generate errors by itself if it fails			// It will automatically go back to a default non-fsaa state on error			return;		// Reapply vsync		vsync(hasVsync);		if (MultiSampling::msNone != pMultiSampling)			::glEnable(GL_MULTISAMPLE);		else			::glDisable(GL_MULTISAMPLE);	}
开发者ID:libyuni,项目名称:libyuni,代码行数:27,


示例4: neosplash

neosplash(){    disp_off();    cls();    load_palette(16,neosprpal,1);    load_vram(0x5000,neospr,0x400);    load_palette(0,badge1pal,1);    set_tile_data(neotiles);    load_tile(0x1000);    for(j=0;j<14;j++){        for(i=0;i<14;i++){            put_tile(j*14+i,i+1,j);        }    }    for(i=0;i<8;i++){        spr_set(i);        spr_pal(0);        spr_pri(1);        spr_ctrl(SIZE_MAS,SZ_32x16);        spr_pattern(0x5000+0x80*i);        spr_y(224-24);        spr_x(i*32);    }    disp_on();    t=0;    for(;;){        t++;        vsync();        joy0=joy(0);        satb_update();        if(joy0&JOY_STRT){            break;        }        if(t>144)break;    }    psgPlay(0);    disp_off();    for(i=0;i<8;i++){        spr_set(i);        spr_hide();    }    satb_update();    cls();    set_color(0,0);    set_color(256,0);    disp_on();    while(joy0&JOY_STRT){        vsync();        joy0=joy(0);    }}
开发者ID:Dodo666,项目名称:OpenEmu-Update,代码行数:55,


示例5: blend_in_rle

void blend_in_rle(int x, int y, RLE_SPRITE* pict,unsigned char frames) {    for (int i=255; i>0; i--) {        draw_lit_rle_sprite(buffer,pict,x,y,i);        for(int j=frames; j>0; j--) vsync();        showbuffer();    }}
开发者ID:Wuerfel21,项目名称:pigs-game,代码行数:7,


示例6: vnpins

voidvnpins(int dosync){	register int d = DEPTH(vcline);	register int e;	e = LINE(vcline) + DEPTH(vcline);	if (e < LINE(vcline + 1)) {		vigoto(e, 0);		vclreol();		return;	}	DEPTH(vcline)++;	if (e < WECHO) {		e = vglitchup(vcline, d);		vigoto(e, 0); vclreol();		if (dosync) {			int (*Ooutchar)() = Outchar;			Outchar = vputchar;			vsync(e + 1);			Outchar = Ooutchar;		}	} else {		vup1();		vigoto(WBOT, 0);		vclreol();	}	vprepins();}
开发者ID:JamesLinus,项目名称:LiteBSD-Ports,代码行数:29,


示例7: jukebox_loop

/** * The main loop of the jukebox. Waits for the end of the song (while updating * the timer) and then returns an indicator that we need the next song. * Also waits for keypresses; the user can press ESC, left arrow or right arrow * to trigger appropriate return codes. */int jukebox_loop() {    int key_p;    while (TRUE) {        while (keypressed()) {            key_p = readkey() >> 8;            if (key_p == KEY_ESC) {                return JUKEBOX_EXIT;            }            if (key_p == KEY_LEFT) {                return JUKEBOX_PREV_SONG;            }            if (key_p == KEY_RIGHT) {                return JUKEBOX_NEXT_SONG;            }        }        clear_bitmap(buffer);        update_starfield(buffer);        update_track_data();        update_song_data();        draw_help();        vsync();        blit(buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);        // When we're at the end of the file, midi_pos will be set to        // the negative number of beats in the song.        if (midi_pos < 0) {            rest(TRACK_CHANGE_WAIT);            return JUKEBOX_NEXT_SONG;        }    }}
开发者ID:msikma,项目名称:ceegee,代码行数:37,


示例8: blend_out_rle

void blend_out_rle(int x, int y, RLE_SPRITE* pict,unsigned short frames) {    for (int i=0; i<256; i++) {        draw_lit_rle_sprite(buffer,pict,x,y,i);        for(int j=frames; j>0; j--) vsync();        showbuffer();    }}
开发者ID:Wuerfel21,项目名称:pigs-game,代码行数:7,


示例9: Update_video

void Update_video(){	/*	 Sync code by Allegro team, thank you guys !	 https://wiki.allegro.cc/index.php?title=Using_Timers_in_Allegro_4	*/			vsync();			while(ticks == 0)	{		rest(1);		} 	while(ticks > 0)	{		int old_ticks = ticks;		ticks--;		if(old_ticks <= ticks)				break; 	}			}
开发者ID:gameblabla,项目名称:gameblablawrapper,代码行数:26,


示例10: highcolor_fade_out

void highcolor_fade_out(int speed){    BITMAP *bmp_orig, *bmp_buff;    if ((bmp_orig = create_bitmap(SCREEN_W, SCREEN_H)))    {        if ((bmp_buff = create_bitmap(SCREEN_W, SCREEN_H)))        {            int a;            blit(screen, bmp_orig, 0,0, 0,0, SCREEN_W, SCREEN_H);            if (speed <= 0) speed = 16;                    for (a = 255-speed; a > 0; a-=speed)            {                clear(bmp_buff);                set_trans_blender(0,0,0,a);                draw_trans_sprite(bmp_buff, bmp_orig, 0, 0);                vsync();                blit(bmp_buff, screen, 0,0, 0,0, SCREEN_W, SCREEN_H);            }            destroy_bitmap(bmp_buff);        }        destroy_bitmap(bmp_orig);    }    rectfill(screen, 0,0, SCREEN_W,SCREEN_H, makecol(0,0,0));}
开发者ID:ftuyama,项目名称:RPG-Game,代码行数:27,


示例11: main

int main(void){ allegro_init(); install_timer(); install_keyboard(); rgb_map = malloc(sizeof(RGB_MAP)); create_rgb_table(rgb_map, desktop_palette, NULL); set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0); buffer = create_bitmap(SCREEN_W, SCREEN_H); set_projection_viewport(0, 0, SCREEN_W, SCREEN_H); init_shape(); while (!key[KEY_ESC]) {   move_shape();   translate_shape();   vsync();   draw(); } destroy_bitmap(buffer); free(rgb_map); allegro_exit(); return 0;}
开发者ID:puyo,项目名称:tankdemo,代码行数:28,


示例12: reset_menu_palette

void reset_menu_palette(void){ vsync();// clear_bitmap(screen); clear_bitmap(display);// arena.target_palette = 0;// set_base_palette();//   set_base_palette();//   int newpal = build_new_palette(arena.change_palette, 0, 0, 0);   vsync();//   clear_bitmap(screen);//   set_palette(palet [newpal]);}
开发者ID:evktalo,项目名称:butterfly,代码行数:16,


示例13: while

void Vga::thread() {	while(true) {		wait(period);		if(address != 0) {			vsync();		}	}}
开发者ID:mascarpato,项目名称:TLM_TP3,代码行数:8,


示例14: change_color

void change_color(int r, int g, int b) {    RGB col;    col.r = r;    col.g = g;    col.b = b;    vsync();    set_color(254, &col);}
开发者ID:simon-joseph,项目名称:Pipeman,代码行数:8,


示例15: _kgfx_draw_screen

void _kgfx_draw_screen(int pid) {    //skip processes that are inactive    if (pid == context_pid[active_context]) {        vsync();        _kgfx_load_palette(contexts[active_context].palette);        blit(&screen, contexts[active_context].backbuffer, 0, 0);    }}
开发者ID:mcheman,项目名称:sysprog,代码行数:8,


示例16: readmouse

uint16 DreamGenContext::waitframes() {	readmouse();	showpointer();	vsync();	dumppointer();	delpointer();	return data.word(kMousebutton);}
开发者ID:TomFrost,项目名称:scummvm,代码行数:8,


示例17: goodbye_menu_circles

void goodbye_menu_circles(void){ int i, j; int finished = 1, thing, speed = 0, timeout = 0; do { clear_to_color(display, COL_BACK1); finished = 1; speed ++; timeout ++; if (timeout > 100)  return; for (i = 0; i < MENU_CIRCLES; i ++) {  if (menu_circle_size [i] <= 0)   break;  finished = 0;  if (menu_circle_size [i] > 0)   menu_circle_size [i] -= 100;  if (minicircle_size [i] > 0)   minicircle_size [i] -= 100;  menu_circle_angle [i] += menu_circle_rot [i];  if (menu_circle_rot [i] < 0)   menu_circle_angle [i] += speed;    else     menu_circle_angle [i] -= speed;  menu_circle_angle [i] &= 1023;  for (j = 0; j < menu_circle_number [i]; j ++)  {   draw_menu_circle(i, j);  } }    do    {        thing ++;    } while (ticked == 0);    ticked = 0; vsync(); blit(display, screen, 0, 0, 100, 0, 600, 600); } while (finished == 0);}
开发者ID:evktalo,项目名称:butterfly,代码行数:58,


示例18: bill_slowfade_bmp

/*  PLEASE, do not use this.  It's not necessary. It wasts processor time.    It's stupid.  I left it here for the sake of compatability. */    void bill_slowfade_bmp(BITMAP *bmp, int clr) { int yoff; int ysub; int xoff; int xadd; for(yoff=0; yoff<=SCREEN_H; yoff +=2) { vsync();  for(ysub=0; ((yoff-ysub)>=0);ysub++)   putpixel(bmp, ysub, yoff-ysub, clr); } for(xoff=0; xoff<=SCREEN_W; xoff +=2) { vsync();  for(xadd=0; ((xoff+xadd)<=SCREEN_W); xadd++)   putpixel(bmp, xoff+xadd, SCREEN_H-xadd, clr); }}
开发者ID:rofl0r,项目名称:GfxRip,代码行数:20,


示例19: Save

static void Save(int asCode){	char filename[128];//      char drive[_MAX_DRIVE];	char dir[96];	char name[32];//      char ext[_MAX_EXT];	char c;	int i;	strcpy(filename, lastFile);	while (1) {		memset(GetDstScreen(), 58, 64000);		TextStringAt(125, 50, "Save as:");		TextGoto(125, 50 + TextHeight());		TextChar('/020');		TextString(filename);		TextChar('/021');		vsync();		CopyToScreen();		c = GetKey();		switch (c) {		case ENTER:			if (!filename[0])				break;			if (asCode) {				SaveCampaignAsC(filename, name, &campaign);			} else {				SaveCampaign(filename, &campaign);			}			fileChanged = 0;			return;		case ESCAPE:			return;		case BACKSPACE:			if (filename[0])				filename[strlen(filename) - 1] = 0;			break;		default:			if (strlen(filename) == sizeof(filename) - 1)				break;			c = toupper(c);			if ((c >= 'A' && c <= 'Z') ||			    c == '-' || c == '_' || c == '//') {				i = strlen(filename);				filename[i + 1] = 0;				filename[i] = c;			}		}	}}
开发者ID:blchinezu,项目名称:EZX-Projects,代码行数:55,


示例20: hsync

static void hsync(const char *message){  if(counter == counter_end) {    CLOCK(message);    screen_hsync();    counter = 0;    line++;    if(line == line_end)      vsync();  }}
开发者ID:nocrew,项目名称:ostis,代码行数:11,


示例21: ConfirmQuit

static int ConfirmQuit(void){	int c;	memset(GetDstScreen(), 58, 64000);	TextStringAt(80, 50, "Campaign has been modified, but not saved");	TextStringAt(110, 50 + TH, "Quit anyway? (Y/N)");	vsync();	CopyToScreen();	c = GetKey();	return (c == 'Y' || c == 'y');}
开发者ID:blchinezu,项目名称:EZX-Projects,代码行数:13,


示例22: show_gripdesign

void show_gripdesign(void){	BITMAP *bmp;	BITMAP *bmp2;	int end=0;	int time=0;		int alpha=255;	bmp2 = load_bitmap("graphic/menu/logo.pcx",NULL);	bmp = create_bitmap(480,480);		stretch_sprite(bmp,bmp2,0,0,480,480);			speed_counter = 0;		while(!key[KEY_ESC] && !end)	{				while(speed_counter>0)		{						time++;			if(time<350 && alpha>0)				alpha-=2;			if(alpha<0)alpha=0;			if(time>350)				alpha+=4;						if(alpha>255)alpha=255;			if(time>450)end=1;			speed_counter--;		}				set_trans_blender(0,0,0,0);		draw_lit_sprite(virt,bmp,0,0,alpha);		vsync();		blit(virt,screen,0,0,80,0,480,480);	}	destroy_bitmap(bmp);	destroy_bitmap(bmp2);}
开发者ID:arvidfm,项目名称:fiend,代码行数:50,


示例23: squirrelsplash

squirrelsplash(){    disp_off();    cls();    foo=6;    put_string("           PC  Engine           ",0,foo);    put_string("        MML Sound Library       ",0,2+foo);    put_string("           'SQUIRREL'           ",0,4+foo);    put_string("         By: Aetherbyte         ",0,6+foo);    put_string("   http://www.aetherbyte.com/   ",0,8+foo);    foo++;    put_string("  Game concept and graphics by  ",0,12+foo);    put_string("   http://lazybraingames.com/   ",0,14+foo);    disp_on();    bar=0;    while(1){        lastjoy0=joy0;        vsync();        bar++;        joy0=joy(0);        if(joy0&JOY_STRT)break;        if(bar>90)break;    }    cls();    while(joy0&JOY_STRT){        vsync();        joy0=joy(0);    }}
开发者ID:Dodo666,项目名称:OpenEmu-Update,代码行数:36,


示例24: highcolor_fade_in

// Fade invoid highcolor_fade_in(BITMAP* bmp_orig, int speed){  BITMAP* bmp_buff = create_bitmap(SCREEN_W,SCREEN_H);  BITMAP* str_orig = create_bitmap( SCREEN_W, SCREEN_H);  stretch_sprite( str_orig, bmp_orig, 0, 0, SCREEN_W, SCREEN_H);  if ( speed<=0)    speed=16;  for(int a=0; a<256; a+=speed){    clear( bmp_buff);    set_trans_blender( 0, 0, 0, a);    draw_trans_sprite( bmp_buff, str_orig, 0, 0);    vsync();    stretch_sprite( screen, bmp_buff, 0, 0,  SCREEN_W, SCREEN_H);  }  stretch_sprite( screen, str_orig, 0, 0,  SCREEN_W, SCREEN_H);}
开发者ID:ADSgames,项目名称:MineSweeper,代码行数:18,


示例25: update_color

/* helper for changing one of the color values */int update_color(void *dp3, int val){   int type = ((unsigned long)dp3 - (unsigned long)colors) / sizeof(colors[0]);   int r, g, b;   float h, s, v;   RGB rgb;   if (colors[type] != val) {      colors[type] = val;      if ((type == S_R) || (type == S_G) || (type == S_B)) {	 /* convert RGB color to HSV */	 r = colors[S_R];	 g = colors[S_G];	 b = colors[S_B];	 rgb_to_hsv(r, g, b, &h, &s, &v);	 colors[S_H] = h * 255.0 / 360.0;	 colors[S_S] = s * 255.0;	 colors[S_V] = v * 255.0;      }      else {	 /* convert HSV color to RGB */	 h = colors[S_H] * 360.0 / 255.0;	 s = colors[S_S] / 255.0;	 v = colors[S_V] / 255.0;	 hsv_to_rgb(h, s, v, &r, &g, &b);	 colors[S_R] = r;	 colors[S_G] = g;	 colors[S_B] = b;      }      /* set the screen background to the new color */      rgb.r = colors[S_R]/4;      rgb.g = colors[S_G]/4;      rgb.b = colors[S_B]/4;      vsync();      set_color(0, &rgb);   }    return D_O_K;}
开发者ID:Grumbel,项目名称:vect,代码行数:47,


示例26: cmd_viewpic

void cmd_viewpic(){    // Views the contents of a WAD file picture.    // WARNING: Needs an error check, to make sure lump is actually a picture.    WAD_PIC *temp_pic;    temp_pic=wad_loadpic(INTERNAL_WAD,parse_words[1]);    if(temp_pic!=NULL){        clear_to_color(vgabuf,0);        draw_scaled_wad_pic(temp_pic,temp_pic->w,temp_pic->h,256,0,0,screen_height);        vsync();        blit(vgabuf,screen,0,0,0,0,screen_width,screen_height);        readkey();        wad_killpic(temp_pic);    }    else{        con_printf("viewpic failed");    }}
开发者ID:amcgregor,项目名称:raven,代码行数:17,


示例27: main

int main(void){        const int8_t *sin = (const int8_t *) &sin256x63[0];        const uint8_t VORIGIN = (LINE_LAST + LINE_FIRST) / 2;        uint8_t r = 0;        uint8_t va = VORIGIN;        uint8_t vb = VORIGIN;        int8_t radd = 1;        volatile uint8_t *vp0 = (uint8_t *) &clist[7].w0;        volatile uint8_t *vp1 = (uint8_t *) &clist[9].w0;        custom->dmacon = DMAF_MASTER | DMAF_ALL;        /* Install the copper list */        copper_install(1, clist);        copper_start();        while (1) {                /* Wait for maximum vertical beam position. */                vsync(VPOS_MAX);                /* Frame loop start */                va = VORIGIN + sin[(uint8_t) r];                vb = VORIGIN + sin[(uint8_t) (r+0x20)];                r += radd;                /*                 * Install new bar horizontal position in copper list. It is                 * important that those writes happen before the copper                 * encounters the corresponding wait instructions.                 */                if (va <= vb) {                        *vp0 = va;                        *vp1 = vb;                } else {                        *vp0 = vb;                        *vp1 = va;                }                /* Frame loop end */        }        return 0;}
开发者ID:endofexclusive,项目名称:amidev,代码行数:44,


示例28: main

int main(){   BITMAP *buffer;   PALETTE pal;   int c;   allegro_init();   install_keyboard();   if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) {      allegro_exit();      printf("Error setting graphics mode/n%s/n/n", allegro_error);      return 1;   }   /* tile 1 colour */   for (c = 1; c != 128; c++) {      pal[c].r = c * 49/127;      pal[c].g = 0;      pal[c].b = c * 63/127;   }   /* tile 2 colour */   for (c = 0; c != 127; c++) {      pal[c + 128].r = 0;      pal[c + 128].g = 0;      pal[c + 128].b = c * 63/127;   }   pal[0].r = pal[0].g = pal[0].b = 0;   pal[255].r = pal[255].g = pal[255].b = 63;   set_pallete(pal);   buffer = create_bitmap(SCREEN_W, SCREEN_H);   while (!key[KEY_ESC]) {      render(buffer);      vsync();      blit(buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);      process_input();   }   destroy_bitmap(buffer);   return 0;}
开发者ID:puyo,项目名称:tankdemo,代码行数:44,


示例29: bufferDuplo

// Duplo buffervoid bufferDuplo ( BITMAP * buffer ){ 	 // sincronizar 	 // como em jogos 3D modernos 	 vsync();   	 // imprime o buffer na tela  (use sempre masked_blit - eh mais rapido)			  // do buffer-> para as creen			  //  pega da posicao 0,0 do buffer e poe na			  // 0,0 da screen, de tamanho RES_W e RES_H  	 masked_blit(buffer, screen, 0,0,0,0, RES_W, RES_H);  	 // o BITMAP * buffer eh como se fosse uma caixa, quando um frame comeca  	 // ( um novo loop do while(!key[KEY_ESC])  nos jogamos tudo fora  	 // e comecamos a colocar coisas novas  	 // depois nos jogamos o conteudo desta caixa na tela  	 // quando estiver tudo pronto     rest(180);}
开发者ID:renannprado,项目名称:snake,代码行数:20,


示例30: highcolor_fade_in

void highcolor_fade_in(BITMAP *bmp_orig, int speed){   BITMAP *bmp_buff;    if ((bmp_buff = create_bitmap(SCREEN_W, SCREEN_H)))    {        int a;        if (speed <= 0) speed = 16;                for (a = 0; a < 256; a+=speed)        {            clear(bmp_buff);            set_trans_blender(0,0,0,a);            draw_trans_sprite(bmp_buff, bmp_orig, 0, 0);            vsync();            blit(bmp_buff, screen, 0,0, 0,0, SCREEN_W, SCREEN_H);        }        destroy_bitmap(bmp_buff);    }     blit(bmp_orig, screen, 0,0, 0,0, SCREEN_W, SCREEN_H);}
开发者ID:ftuyama,项目名称:RPG-Game,代码行数:22,



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


C++ vsync_irq_disable函数代码示例
C++ vswprintf_s函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。