u8g2-copy/sys/sdl/hello_world_8x8/main.c

34 lines
607 B
C
Raw Normal View History

2015-11-07 04:07:14 +08:00
#include "u8x8.h"
2016-08-10 05:22:00 +08:00
u8x8_t u8x8;
2015-11-07 04:07:14 +08:00
int main(void)
{
2016-08-10 05:22:00 +08:00
u8x8_Setup_SDL_128x64(&u8x8);
u8x8_InitDisplay(&u8x8);
2015-11-07 04:07:14 +08:00
2016-08-10 05:22:00 +08:00
u8x8_SetFont(&u8x8, u8x8_font_amstrad_cpc_extended_f);
2015-11-07 04:07:14 +08:00
2016-08-10 05:22:00 +08:00
u8x8_DrawString(&u8x8, 0, 0, "Hello World!");
2018-01-22 00:00:06 +08:00
u8x8_Draw1x2String(&u8x8, 0, 1, "Hello World!");
2016-08-10 05:22:00 +08:00
u8x8_Draw2x2String(&u8x8, 0, 3, "Hello World!");
2015-11-25 05:21:17 +08:00
2019-01-02 17:34:44 +08:00
while( u8g_sdl_get_key() < 0 )
;
u8x8_ClearDisplay(&u8x8);
u8x8_SetFont(&u8x8, u8x8_font_7x14_1x2_f );
u8x8_Draw1x2String(&u8x8, 0, 0, "Hello World!");
u8x8_Draw2x2String(&u8x8, 0, 4, "Hello World!");
2015-11-07 04:07:14 +08:00
while( u8g_sdl_get_key() < 0 )
;
2015-11-25 05:21:17 +08:00
2015-11-07 04:07:14 +08:00
return 0;
}