aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-08-20 13:54:54 +1000
committerinmarket <andrewh@inmarket.com.au>2014-08-20 13:54:54 +1000
commit99da5c825b217e1341fb3b3440ad7d4b76a06bfe (patch)
treeb81d6844e2396a8e0fe7cf426f1954ba63f0c52b
parente4880b72697feff3b4423f48cf77d015c114776c (diff)
downloaduGFX-99da5c825b217e1341fb3b3440ad7d4b76a06bfe.tar.gz
uGFX-99da5c825b217e1341fb3b3440ad7d4b76a06bfe.tar.bz2
uGFX-99da5c825b217e1341fb3b3440ad7d4b76a06bfe.zip
Update gl3d spin demo
-rw-r--r--demos/modules/gwin/gl3d-spin/demo.mk (renamed from demos/modules/gwin/gl3d/demo.mk)2
-rw-r--r--demos/modules/gwin/gl3d-spin/gfxconf.h (renamed from demos/modules/gwin/gl3d/gfxconf.h)0
-rw-r--r--demos/modules/gwin/gl3d-spin/main.c (renamed from demos/modules/gwin/gl3d/main.c)20
3 files changed, 7 insertions, 15 deletions
diff --git a/demos/modules/gwin/gl3d/demo.mk b/demos/modules/gwin/gl3d-spin/demo.mk
index 2f20deb6..bed1ab31 100644
--- a/demos/modules/gwin/gl3d/demo.mk
+++ b/demos/modules/gwin/gl3d-spin/demo.mk
@@ -1,3 +1,3 @@
-DEMODIR = $(GFXLIB)/demos/modules/gwin/gl3d
+DEMODIR = $(GFXLIB)/demos/modules/gwin/gl3d-spin
GFXINC += $(DEMODIR)
GFXSRC += $(DEMODIR)/main.c
diff --git a/demos/modules/gwin/gl3d/gfxconf.h b/demos/modules/gwin/gl3d-spin/gfxconf.h
index d0375a19..d0375a19 100644
--- a/demos/modules/gwin/gl3d/gfxconf.h
+++ b/demos/modules/gwin/gl3d-spin/gfxconf.h
diff --git a/demos/modules/gwin/gl3d/main.c b/demos/modules/gwin/gl3d-spin/main.c
index f93f37ec..4a8b25e6 100644
--- a/demos/modules/gwin/gl3d/main.c
+++ b/demos/modules/gwin/gl3d-spin/main.c
@@ -29,7 +29,7 @@
#include "gfx.h"
-/* The handles for our two Windows */
+/* The handle for our Window */
GHandle gh;
static GLfloat Xrot, Xstep;
@@ -107,7 +107,7 @@ static void draw( void )
}
-static void idle( void )
+static void spin( void )
{
Xrot += Xstep;
Yrot += Ystep;
@@ -138,19 +138,11 @@ int main(void) {
GWindowInit wi;
gwinClearInit(&wi);
- wi.show = TRUE; wi.x = 20; wi.y = 10; wi.width = 200; wi.height = 150;
+ wi.show = TRUE; wi.x = 8; wi.y = 8; wi.width = gdispGetWidth()-16; wi.height = gdispGetHeight()-16;
gh = gwinGL3DCreate(0, &wi);
}
- /* Set fore- and background colors */
- gwinSetColor(gh, White);
- gwinSetBgColor(gh, Blue);
-
- /* Clear the window */
- gwinClear(gh);
-
/* Init the 3D stuff */
- glViewport(0, 0, (GLint)gwinGetWidth(gh), (GLint)gwinGetHeight(gh));
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 15.0 );
@@ -158,10 +150,10 @@ int main(void) {
Object = make_object();
glCullFace( GL_BACK );
- // glEnable( GL_CULL_FACE );
+ //glEnable( GL_CULL_FACE );
glDisable( GL_DITHER );
glShadeModel( GL_FLAT );
- // glEnable( GL_DEPTH_TEST );
+ //glEnable( GL_DEPTH_TEST );
Xrot = Yrot = Zrot = 0.0;
Xstep = Step;
Ystep = Zstep = 0.0;
@@ -173,7 +165,7 @@ int main(void) {
gfxSleepMilliseconds(10);
// move and redraw
- idle();
+ spin();
}
}