Update gl3d demos so they run on real hardware (STMF407VGT6). Basically reduce the zbuffer size.

ugfx_release_2.6
inmarket 2014-08-20 22:52:40 +10:00
parent 0f3f8f68f8
commit fbc9ce3a45
2 changed files with 10 additions and 4 deletions

View File

@ -29,6 +29,9 @@
#include "gfx.h" #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> #include <math.h>
#ifndef M_PI #ifndef M_PI
# define M_PI 3.14159265 # define M_PI 3.14159265
@ -267,7 +270,7 @@ int main(void) {
GWindowInit wi; GWindowInit wi;
gwinClearInit(&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); gh = gwinGL3DCreate(0, &wi);
} }
@ -278,7 +281,7 @@ int main(void) {
while(TRUE) { while(TRUE) {
// rate control // rate control
gfxSleepMilliseconds(10); gfxSleepMilliseconds(FRAME_DELAY);
// move and redraw // move and redraw
spin(); spin();

View File

@ -29,6 +29,9 @@
#include "gfx.h" #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 */ /* The handle for our Window */
GHandle gh; GHandle gh;
@ -138,7 +141,7 @@ int main(void) {
GWindowInit wi; GWindowInit wi;
gwinClearInit(&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); gh = gwinGL3DCreate(0, &wi);
} }
@ -162,7 +165,7 @@ int main(void) {
while(TRUE) { while(TRUE) {
// rate control // rate control
gfxSleepMilliseconds(10); gfxSleepMilliseconds(FRAME_DELAY);
// move and redraw // move and redraw
spin(); spin();