diff options
author | Andrew Hannam <Andrew Hannam> | 2016-07-28 16:35:36 +1000 |
---|---|---|
committer | Andrew Hannam <Andrew Hannam> | 2016-07-28 16:35:36 +1000 |
commit | 12dfd8232fe32345bd60f04d73a1a40adf38e841 (patch) | |
tree | 803aaeb35b26e6b9fd3b01136398c5157f7f6f1f /demos/games/justget10/main.c | |
parent | 868a272d6e44c267d84420932247b942c07d5713 (diff) | |
download | uGFX-12dfd8232fe32345bd60f04d73a1a40adf38e841.tar.gz uGFX-12dfd8232fe32345bd60f04d73a1a40adf38e841.tar.bz2 uGFX-12dfd8232fe32345bd60f04d73a1a40adf38e841.zip |
Move demo games into demo/games directory
Diffstat (limited to 'demos/games/justget10/main.c')
-rw-r--r-- | demos/games/justget10/main.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/demos/games/justget10/main.c b/demos/games/justget10/main.c new file mode 100644 index 00000000..11ee13c7 --- /dev/null +++ b/demos/games/justget10/main.c @@ -0,0 +1,40 @@ +#include "gfx.h" +#include "jg10.h" + +int main(void) +{ + GEventMouse ev; +#if !JG10_SHOW_SPLASH + font_t font; +#endif + + gfxInit(); + + ginputGetMouse(0); + jg10Init(); + +#if JG10_SHOW_SPLASH + jg10ShowSplash(); +#else + font = gdispOpenFont("DejaVuSans16_aa"); + gdispDrawString((gdispGetWidth()/2)-(gdispGetStringWidth("Touch to start!", font)/2), gdispGetHeight()/2, "Touch to start!", font, White); + gdispCloseFont(font); +#endif + + while (TRUE) { + ginputGetMouseStatus(0, &ev); + if (ev.buttons & GINPUT_MOUSE_BTN_LEFT) { + while (ev.buttons & GINPUT_MOUSE_BTN_LEFT) { // Wait until release + ginputGetMouseStatus(0, &ev); + } + +#if !JG10_SHOW_SPLASH + font = gdispOpenFont("DejaVuSans16"); + gdispFillArea((gdispGetWidth()/2)-(gdispGetStringWidth("Touch to start!", font)/2), gdispGetHeight()/2, gdispGetWidth()/2, 17, Black); + gdispCloseFont(font); +#endif + + jg10Start(); + } + } +} |