This commit is contained in:
olikraus 2016-11-24 22:49:30 +01:00
parent 3ca4d3cf32
commit 60802e7af5
2 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,12 @@
CFLAGS = -g -Wall -I../../../csrc/. `sdl-config --cflags`
SRC = $(shell ls ../../../csrc/*.c) $(shell ls ../common/*.c ) main.c
OBJ = $(SRC:.c=.o)
helloworld: $(OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) `sdl-config --libs` -o u8g2_sdl
clean:
-rm $(OBJ) u8g2_sdl

View File

@ -0,0 +1,45 @@
#include "u8x8.h"
u8x8_t u8x8;
uint8_t tile_list[] =
{
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0,
0x0f0
};
int main(void)
{
u8x8_Setup_SDL_128x64(&u8x8);
u8x8_InitDisplay(&u8x8);
u8x8_SetFont(&u8x8, u8x8_font_amstrad_cpc_extended_f);
u8x8_DrawString(&u8x8, 0, 0, "draw tile");
u8x8_DrawTile(&u8x8, 0, 1, 2, tile_list);
while( u8g_sdl_get_key() < 0 )
;
return 0;
}