本文整理汇总了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;
}
示例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++));
}
}
示例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 );
}
}
}
示例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);
}
}
示例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++;
}
}
示例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++;
}
}
示例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]);
}
}
示例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);
}
}
示例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]);
}
}
示例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);
}
}
示例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(¤t_time);
time_info = localtime(¤t_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++;
}
}
示例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++;
}
}
示例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;
};
示例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;
}
}
示例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);
}
}