changeset 3410:f4bc25567731

Optimizations.
author Mike Gorchak <lestat@i.com.ua>
date Thu, 22 Oct 2009 06:07:05 +0000
parents c8f580ebc96a
children d15a4daa4a58
files test/testdyngles.c
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/test/testdyngles.c	Thu Oct 22 04:46:11 2009 +0000
+++ b/test/testdyngles.c	Thu Oct 22 06:07:05 2009 +0000
@@ -50,11 +50,8 @@
 
 typedef struct
 {
-    //void (APIENTRY * glBegin) (GLenum);
-    //void (APIENTRY * glEnd) ();
-    //void (APIENTRY * glVertex3f) (GLfloat, GLfloat, GLfloat);
-
     void (APIENTRY * glEnableClientState) (GLenum array);
+    void (APIENTRY * glDisableClientState) (GLenum array);
     void (APIENTRY * glVertexPointer) (GLint size, GLenum type,
                                        GLsizei stride,
                                        const GLvoid * pointer);
@@ -83,6 +80,7 @@
 init_glfuncs(glfuncs * f)
 {
     f->glEnableClientState = get_funcaddr("glEnableClientState");
+    f->glDisableClientState = get_funcaddr("glDisableClientState");
     f->glVertexPointer = get_funcaddr("glVertexPointer");
     f->glDrawArrays = get_funcaddr("glDrawArrays");
     f->glClearColor = get_funcaddr("glClearColor");
@@ -119,8 +117,8 @@
     video_w = 320;
     video_h = 480;
 #ifdef __QNXNTO__
+    video_w = 480;
     video_h = 640;
-    video_w = 480;
 #endif /* __QNXNTO__ */
 
     if (argv[1]) {
@@ -176,12 +174,15 @@
 
     f.glEnable(GL_POINT_SMOOTH);
     f.glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
-    f.glPointSize(5.0f);
+    f.glPointSize(1.0f);
     f.glEnable(GL_FOG);
     f.glFogf(GL_FOG_START, -500);
     f.glFogf(GL_FOG_END, 500);
     f.glFogf(GL_FOG_DENSITY, 0.005);
 
+    f.glVertexPointer(3, GL_FLOAT, 0, pixels);
+    f.glEnableClientState(GL_VERTEX_ARRAY);
+
     do {
         f.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
@@ -190,8 +191,6 @@
 
         f.glColor4f(1.0, 1.0, 1.0, 1.0);
 
-        f.glEnableClientState(GL_VERTEX_ARRAY);
-        f.glVertexPointer(3, GL_FLOAT, 0, pixels);
         f.glDrawArrays(GL_POINTS, 0, NB_PIXELS);
 
         SDL_GL_SwapBuffers();
@@ -207,6 +206,8 @@
     }
     while (!done);
 
+    f.glDisableClientState(GL_VERTEX_ARRAY);
+
     SDL_Quit();
     return 0;
 }