Merge remote branch 'origin/master' into lp-binning
[mesa.git] / progs / tests / stencil_twoside.c
index 8826c46fc265515a804b1cef2f259fd626ac6703..7d871e5877fa9336cd32fb988034c665fe58d6d1 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 static int use20syntax = 1;
@@ -273,9 +274,9 @@ static void Init( void )
    if (atof( ver_string ) < 2.0) {
       use20syntax = 0;
    }
-   stencil_func_separate = glutGetProcAddress( "glStencilFuncSeparate" );
-   stencil_func_separate_ati = glutGetProcAddress( "glStencilFuncSeparateATI" );
-   stencil_op_separate = glutGetProcAddress( "glStencilOpSeparate" );
+   stencil_func_separate = (PFNGLSTENCILFUNCSEPARATEPROC) glutGetProcAddress( "glStencilFuncSeparate" );
+   stencil_func_separate_ati = (PFNGLSTENCILFUNCSEPARATEATIPROC) glutGetProcAddress( "glStencilFuncSeparateATI" );
+   stencil_op_separate = (PFNGLSTENCILOPSEPARATEPROC) glutGetProcAddress( "glStencilOpSeparate" );
 
    printf("\nAll 5 squares should be the same color.\n");
 }
@@ -288,6 +289,7 @@ int main( int argc, char *argv[] )
    glutInitWindowSize( Width, Height );
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
    glutCreateWindow( "GL_ATI_separate_stencil test" );
+   glewInit();
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutDisplayFunc( Display );