当前位置: 首页>>代码示例>>C++>>正文


C++ draw_char函数代码示例

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


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

示例1: console_putc

int console_putc(int ch) {
#if defined (ARM_ALLOW_MULTI_CORE)
	while (__sync_lock_test_and_set(&lock, 1) == 1);
#endif

	if (ch == (int)'\n') {
		newline();
	} else if (ch == (int)'\r') {
		current_x = 0;
	} else if (ch == (int)'\t') {
		current_x += 4;
	} else {
		draw_char(ch, current_x * FB_CHAR_W, current_y * FB_CHAR_H, cur_fore, cur_back);
		current_x++;
		if (current_x == FB_WIDTH / FB_CHAR_W) {
			newline();
		}
	}

#if defined (ARM_ALLOW_MULTI_CORE)
	__sync_lock_release(&lock);
#endif

	return ch;
}
开发者ID:vanvught,项目名称:rpidmx512,代码行数:25,代码来源:console_fb.c

示例2: draw_string

static void draw_string(int x, int y, const char *s, int w) {
	if (s == NULL)
		return;
	for (; *s && w; w--) {
		draw_char(x++,y,*(s++));
	}
}
开发者ID:CrashSerious,项目名称:PS3Roar,代码行数:7,代码来源:ui_gp32.c

示例3: fill_rect

void fill_rect( int left, int top, int width, int height, char ch )
{

	int right = left + width - 1;
	int bottom = top + height - 1;

	if( width <= 0 || height <= 0 )
	{
	}
	else if( width == 1 && height == 1 )
	{
		draw_char( left, top, ch );
	}
	else if( width == 1 )
	{
		draw_line( left, top, left, bottom, ch );
	}
	else if ( height == 1 )
	{
		draw_line( left, top, right, top, ch );
	}
	else
	{
		for( int i = 0; i < height; i++ )
		{
			draw_line( left, top + i, right, top + i, ch );
		}
	}
}
开发者ID:NathanRamage,项目名称:CAB202,代码行数:29,代码来源:fill_rect.c

示例4: scroll

static void scroll(void) {
	int i;

	for (i = 0; i < (40 * 29); i++) {
		const int ch = (int) shadow_ram[i + 40].ch;
		const uint16_t fore = shadow_ram[i + 40].fore;
		const uint16_t back = shadow_ram[i + 40].back;
		const uint32_t x = i / 40;
		const uint32_t y = i - 40 * x;

		draw_char(ch, x, y, fore, back);
	}

	for (i = 0; i < 40; i++) {
		draw_char(' ', 29, i, cur_fore, cur_back);
	}
}
开发者ID:vanvught,项目名称:rpidmx512,代码行数:17,代码来源:ili9340.c

示例5: draw_text

void draw_text(int x, int y, const char *text, color_t  c) {
    int counter =0;
    while(text[counter] != '\0') {
        draw_char(x,y,text[counter], c);
        x+=8;
        counter++;
    }
}
开发者ID:Chris-grant1995,项目名称:CS1550,代码行数:8,代码来源:library.c

示例6: while

void Display::draw_text(uint16_t x, uint16_t y, const char* c)
{
    while (*c != 0) {
        draw_char(x, y, *c);
        x += 7;
        c++;
    }
}
开发者ID:ArmaJo,项目名称:ardupilot,代码行数:8,代码来源:Display.cpp

示例7: draw_text_line

static void draw_text_line(duc_graph *g, double x, double y, double size, char *text, int l)
{
	int i;
	
	for(i=0; i<l; i++) {
		x += draw_char(g, x, y, size, text[i]);
	}
}
开发者ID:Solertis,项目名称:duc,代码行数:8,代码来源:graph-opengl.c

示例8: show_route

void show_route(void)
{
   int k;
   for(k=route_count-1; k>=0; k--)
   {
      draw_char(route[k].x, route[k].y, ' ', 0x47);
   }
}
开发者ID:375670450,项目名称:BugEat,代码行数:8,代码来源:bugeatwc.c

示例9: draw_string

void draw_string(int x, int y, char *s)
{
	int i;

	for (i = 0; i < strlen(s); i++)
	{
		draw_char(x + i, y, s[i]);
	}
}
开发者ID:Crazedpeanut,项目名称:WindowsConsoleGameEngine,代码行数:9,代码来源:Display.c

示例10: tfont_draw_string

void tfont_draw_string(const char* s) {
    if(!tfont_init())
        sys_err("tfont not initialized");
    while(*s) {
        unsigned char ch = (unsigned char) *s++;
        draw_char(ch);
        glTranslatef(_bm_w, 0, 0);
    }
}
开发者ID:mmmmhack,项目名称:vblend,代码行数:9,代码来源:tfont.c

示例11: gamelib_mainmenu

void gamelib_mainmenu(){
	int n,j;
	int t = 0;
	double d=0;
	char *text;

	time_t current_time;
	struct tm * time_info;
	char timeString[8];



	while(nunchuck_read()){
		nunchuck_init();
		//nunchuck_read();
		mvprintw(6,0,"nunchuck reinited\n");
	}
	while(buttonC && buttonZ){
		while(nunchuck_read()){
			nunchuck_init();
			//nunchuck_read();
			mvprintw(6,0,"nunchuck reinited\n");
		}
		
		if(t%800 < 100){
			text = "PLAY";
			d = 3.03;
		}
		else if(t%800 < 200) {
			text = "GAMES";
			d = 0.03;
		}	
		else{
			time(&current_time);
			time_info = localtime(&current_time);
			strftime(timeString, 8, "%H:%M", time_info);
			
			if(current_time%2){
				timeString[2] = ' ';
			}
			text = timeString;
			d=0.03;
		}
		
		n=0;
		while(text[n] && n < 6){
			draw_char(n*6+d, text[n]);
			n++;
		}
		blit();
		update();
		
		t++;
	}


}	
开发者ID:armageddon421,项目名称:blinkenpi,代码行数:57,代码来源:gamelib.c

示例12: draw_text

void draw_text(uint8_t x, uint8_t y, const char *text, uint8_t r,uint8_t g,uint8_t b)
{
	while (*text)
	{
		draw_char(x,y,*text,r,b,g);
		x+=6;
		text++;
	}

}
开发者ID:sebseb7,项目名称:oled,代码行数:10,代码来源:text.c

示例13: draw_cursor

/* 
	We do not want to redraw our input window every time the cursor blinks.
	We only redraw the character under the cursor.
	For that we have to known the position in the text at which the cursor is.
	If the cursor is past the last character in the window text, we draw a space.
*/	
static uint8_t
draw_cursor(struct Window *win, uint8_t cursor_pos, uint8_t reversed){
	char ch;
	int cc;
	
	set_font(win->font);			// necessary !
	cc = cursor_col(cursor_pos);
	
	/* If we are past the text length, draw space */
	if (cursor_pos >= win->text_len) ch = ' ';
	else ch = win->txt[cursor_pos];
	
	if (reversed)
		draw_char(win_txt_row(win), win_txt_col(win)+ cc, ch, win->bg_color, win->fg_color, txt_col_lim(win) - cc ); 
	else	
		draw_char(win_txt_row(win), win_txt_col(win)+ cc, ch, win->fg_color, win->bg_color, txt_col_lim(win) - cc ); 
	
	return 1;
};
开发者ID:HerrSchrader,项目名称:McBetty,代码行数:25,代码来源:window.c

示例14: draw_string

//Draw a string of chars
void draw_string(char s[], int x, int y) {

	int i;

	for (i = 0; i < strlen(s); i++) {
	
		draw_char(s[i],x,y);
		x += 20;
	}
}
开发者ID:RastaCat,项目名称:EssiInvaders,代码行数:11,代码来源:si.c

示例15: draw_page_title

static void draw_page_title(void)
{
	int x, tpos, tlen = strlen(ACTIVE_PAGE.title);

	if (tlen > 0) {
		tpos = 41 - ((tlen + 1) / 2);

		for (x = 1; x < tpos - 1; x++)
			draw_char(154, x, 11, 1, 2);
		draw_char(0, tpos - 1, 11, 1, 2);
		draw_text(ACTIVE_PAGE.title, tpos, 11, 0, 2);
		draw_char(0, tpos + tlen, 11, 1, 2);
		for (x = tpos + tlen + 1; x < 79; x++)
			draw_char(154, x, 11, 1, 2);
	} else {
		for (x = 1; x < 79; x++)
			draw_char(154, x, 11, 1, 2);
	}
}
开发者ID:HybridDog,项目名称:schismtracker,代码行数:19,代码来源:page.c


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