Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Optimizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
llmike committed Oct 22, 2009
1 parent 7894b38 commit cc4ff58
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions test/testdyngles.c
Expand Up @@ -50,11 +50,8 @@ get_funcaddr(const char *p)

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);
Expand Down Expand Up @@ -83,6 +80,7 @@ void
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");
Expand Down Expand Up @@ -119,8 +117,8 @@ main(int argc, char *argv[])
video_w = 320;
video_h = 480;
#ifdef __QNXNTO__
video_h = 640;
video_w = 480;
video_h = 640;
#endif /* __QNXNTO__ */

if (argv[1]) {
Expand Down Expand Up @@ -176,12 +174,15 @@ main(int argc, char *argv[])

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);

Expand All @@ -190,8 +191,6 @@ main(int argc, char *argv[])

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();
Expand All @@ -207,6 +206,8 @@ main(int argc, char *argv[])
}
while (!done);

f.glDisableClientState(GL_VERTEX_ARRAY);

SDL_Quit();
return 0;
}
Expand Down

0 comments on commit cc4ff58

Please sign in to comment.