diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-08-20 22:52:40 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-08-20 22:52:40 +1000 |
commit | fbc9ce3a451e90cdc04ceb22765762fa22979578 (patch) | |
tree | 584f251820ac22918b8cc360b022f48a3f8c6507 /demos/modules/gwin | |
parent | 0f3f8f68f87233bf59c3fa68c3dfe1f492a1a478 (diff) | |
download | uGFX-fbc9ce3a451e90cdc04ceb22765762fa22979578.tar.gz uGFX-fbc9ce3a451e90cdc04ceb22765762fa22979578.tar.bz2 uGFX-fbc9ce3a451e90cdc04ceb22765762fa22979578.zip |
Update gl3d demos so they run on real hardware (STMF407VGT6). Basically reduce the zbuffer size.
Diffstat (limited to 'demos/modules/gwin')
-rw-r--r-- | demos/modules/gwin/gl3d-gears/main.c | 7 | ||||
-rw-r--r-- | demos/modules/gwin/gl3d-spin/main.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/demos/modules/gwin/gl3d-gears/main.c b/demos/modules/gwin/gl3d-gears/main.c index 4ee189af..2bc4ed84 100644 --- a/demos/modules/gwin/gl3d-gears/main.c +++ b/demos/modules/gwin/gl3d-gears/main.c @@ -29,6 +29,9 @@ #include "gfx.h" +#define GL3D_WINDOW_SIZE 120 // Limits zbuffer size to program runs in 192k limit on STMF407 +#define FRAME_DELAY 20 // 20ms should be approx 50 frames per second less CPU overheads. + #include <math.h> #ifndef M_PI # define M_PI 3.14159265 @@ -267,7 +270,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; wi.x = 8; wi.y = 8; wi.width = gdispGetWidth()-16; wi.height = gdispGetHeight()-16; + wi.show = TRUE; wi.x = (gdispGetWidth()-GL3D_WINDOW_SIZE)/2; wi.y = (gdispGetHeight()-GL3D_WINDOW_SIZE)/2; wi.width = GL3D_WINDOW_SIZE; wi.height = GL3D_WINDOW_SIZE; gh = gwinGL3DCreate(0, &wi); } @@ -278,7 +281,7 @@ int main(void) { while(TRUE) { // rate control - gfxSleepMilliseconds(10); + gfxSleepMilliseconds(FRAME_DELAY); // move and redraw spin(); diff --git a/demos/modules/gwin/gl3d-spin/main.c b/demos/modules/gwin/gl3d-spin/main.c index 4a8b25e6..2b80994f 100644 --- a/demos/modules/gwin/gl3d-spin/main.c +++ b/demos/modules/gwin/gl3d-spin/main.c @@ -29,6 +29,9 @@ #include "gfx.h" +#define GL3D_WINDOW_SIZE 120 // Limits zbuffer size to program runs in 192k limit on STMF407 +#define FRAME_DELAY 20 // 20ms should be approx 50 frames per second less CPU overheads. + /* The handle for our Window */ GHandle gh; @@ -138,7 +141,7 @@ int main(void) { GWindowInit wi; gwinClearInit(&wi); - wi.show = TRUE; wi.x = 8; wi.y = 8; wi.width = gdispGetWidth()-16; wi.height = gdispGetHeight()-16; + wi.show = TRUE; wi.x = (gdispGetWidth()-GL3D_WINDOW_SIZE)/2; wi.y = (gdispGetHeight()-GL3D_WINDOW_SIZE)/2; wi.width = GL3D_WINDOW_SIZE; wi.height = GL3D_WINDOW_SIZE; gh = gwinGL3DCreate(0, &wi); } @@ -162,7 +165,7 @@ int main(void) { while(TRUE) { // rate control - gfxSleepMilliseconds(10); + gfxSleepMilliseconds(FRAME_DELAY); // move and redraw spin(); |