prog/tests: Fix MSVC build.
authorVinson Lee <vlee@vmware.com>
Wed, 14 Oct 2009 13:43:18 +0000 (07:43 -0600)
committerVinson Lee <vlee@vmware.com>
Thu, 3 Dec 2009 23:05:44 +0000 (15:05 -0800)
(cherry picked from commit ea862ec8ff4a52b30b822e737d93a49330be9e31)

progs/tests/arraytexture.c

index 6c0484df0de69d70c7b78ce65c95ddf9430de882..28252a354bffbf60ecfc86b672a2f74d484f5115 100644 (file)
@@ -77,10 +77,6 @@ static GLfloat texZ = 0.0;
 static GLfloat texZ_dir = 0.01;
 static GLint num_layers;
 
-static PFNGLBINDPROGRAMARBPROC bind_program;
-static PFNGLPROGRAMSTRINGARBPROC program_string;
-static PFNGLGENPROGRAMSARBPROC gen_programs;
-
 
 static void
 PrintString(const char *s)
@@ -125,13 +121,13 @@ static void Display(void)
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
 
-   (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, 0);
+   glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0);
    glColor3f(1,1,1);
    glRasterPos3f(-0.9, -0.9, 0.0);
    sprintf(str, "Texture Z coordinate = %4.1f", texZ);
    PrintString(str);
 
-   (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, 1);
+   glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 1);
    GL_CHECK_ERROR();
    glEnable(GL_TEXTURE_2D_ARRAY_EXT);
    GL_CHECK_ERROR();
@@ -159,7 +155,7 @@ static void Display(void)
 
    glDisable(GL_TEXTURE_2D_ARRAY_EXT);
    GL_CHECK_ERROR();
-   (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, 0);
+   glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0);
    GL_CHECK_ERROR();
 
    glutSwapBuffers();
@@ -226,8 +222,8 @@ compile_fragment_program(GLuint id, const char *prog)
    int err;
 
    err = glGetError();
-   (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, id);
-   (*program_string)(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+   glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, id);
+   glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
                      strlen(prog), (const GLubyte *) prog);
 
    glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos);
@@ -264,11 +260,6 @@ static void Init(void)
    require_extension("GL_MESA_texture_array");
    require_extension("GL_SGIS_generate_mipmap");
 
-   bind_program = glutGetProcAddress("glBindProgramARB");
-   program_string = glutGetProcAddress("glProgramStringARB");
-   gen_programs = glutGetProcAddress("glGenProgramsARB");
-
-
    for (num_layers = 0; textures[num_layers] != NULL; num_layers++)
       /* empty */ ;