diff options
| author | Joel Bodenmann <joel@embedded.pro> | 2016-07-27 16:34:41 +0200 | 
|---|---|---|
| committer | Joel Bodenmann <joel@embedded.pro> | 2016-07-27 16:34:41 +0200 | 
| commit | 85ec38ac1ce0a978333d4d2d71b13195cbf8953a (patch) | |
| tree | e3cd44c2d46182c768c64a1495575adb1dd0abf8 /demos/applications/justget10/main.c | |
| parent | 2fe5c112b077d12874eb736bcf9cbf012f3c41ad (diff) | |
| download | uGFX-85ec38ac1ce0a978333d4d2d71b13195cbf8953a.tar.gz uGFX-85ec38ac1ce0a978333d4d2d71b13195cbf8953a.tar.bz2 uGFX-85ec38ac1ce0a978333d4d2d71b13195cbf8953a.zip  | |
Adding applications/justget10 demo
Diffstat (limited to 'demos/applications/justget10/main.c')
| -rw-r--r-- | demos/applications/justget10/main.c | 40 | 
1 files changed, 40 insertions, 0 deletions
diff --git a/demos/applications/justget10/main.c b/demos/applications/justget10/main.c new file mode 100644 index 00000000..11ee13c7 --- /dev/null +++ b/demos/applications/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(); +        } +    } +}  | 
