aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2014-10-28 00:10:19 +0100
committerJoel Bodenmann <joel@unormal.org>2014-10-28 00:10:19 +0100
commit08292eb7d0a0f71e222ae5e4f3fd0a7619bf29c6 (patch)
tree5e82c55b4c96d24dbdebc7be61d22c5db462a944 /demos
parentd4c68c5afefbbee7fd5926a242b73f223c8ff3a2 (diff)
downloaduGFX-08292eb7d0a0f71e222ae5e4f3fd0a7619bf29c6.tar.gz
uGFX-08292eb7d0a0f71e222ae5e4f3fd0a7619bf29c6.tar.bz2
uGFX-08292eb7d0a0f71e222ae5e4f3fd0a7619bf29c6.zip
Simplifying gdisp/arcsectors demo to only use the GDISP module
Diffstat (limited to 'demos')
-rw-r--r--demos/modules/gdisp/arcsectors/gfxconf.h4
-rw-r--r--demos/modules/gdisp/arcsectors/main.c26
2 files changed, 6 insertions, 24 deletions
diff --git a/demos/modules/gdisp/arcsectors/gfxconf.h b/demos/modules/gdisp/arcsectors/gfxconf.h
index 49470b2f..df6d85c0 100644
--- a/demos/modules/gdisp/arcsectors/gfxconf.h
+++ b/demos/modules/gdisp/arcsectors/gfxconf.h
@@ -38,15 +38,11 @@
/* GFX sub-systems to turn on */
#define GFX_USE_GDISP TRUE
-#define GFX_USE_GINPUT TRUE
-#define GFX_USE_GEVENT TRUE
-#define GFX_USE_GTIMER TRUE
/* Features for the GDISP subsystem. */
#define GDISP_NEED_VALIDATION TRUE
#define GDISP_NEED_ARCSECTORS TRUE
-#define GINPUT_NEED_MOUSE TRUE
#endif /* _GFXCONF_H */
diff --git a/demos/modules/gdisp/arcsectors/main.c b/demos/modules/gdisp/arcsectors/main.c
index 9d282207..9908523f 100644
--- a/demos/modules/gdisp/arcsectors/main.c
+++ b/demos/modules/gdisp/arcsectors/main.c
@@ -29,12 +29,9 @@
#include "gfx.h"
-GListener gl;
-
int main(void) {
coord_t width, height, r1, r2, cx, cy;
uint8_t sectors;
- GEventMouse *pme;
// Initialize and clear the display
gfxInit();
@@ -42,35 +39,24 @@ int main(void) {
// Get the screen size
width = gdispGetWidth();
height = gdispGetHeight();
+
+ // Initialize some variables
r1 = width > height ? height/3 : width/3;
r2 = r1*3/4;
cx = width/2;
cy = height/2;
sectors = 1;
- // We want to listen for mouse button events
- geventListenerInit(&gl);
- geventAttachSource(&gl, ginputGetMouse(0), GLISTEN_MOUSEMETA);
-
while(1) {
// Draw the arc sectors
gdispClear(White);
gdispDrawArcSectors(cx, cy, r1, sectors, Blue);
gdispFillArcSectors(cx, cy, r2, sectors, Red);
- // Get an Event
- pme = (GEventMouse *)geventEventWait(&gl, TIME_INFINITE);
+ // Increase the sectors counter
+ sectors++;
- // Change our sectors based on the event.
- switch(pme->type) {
- case GEVENT_MOUSE:
- case GEVENT_TOUCH:
- if (pme->buttons & GMETA_MOUSE_CLICK)
- sectors++;
- else if (pme->buttons & GMETA_MOUSE_CXTCLICK)
- sectors--;
- break;
- }
+ // Waste some time
+ gfxSleepMilliseconds(250);
}
}
-