diff options
Diffstat (limited to 'progs/vp/vp-tris.c')
-rw-r--r-- | progs/vp/vp-tris.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index 58014dd48de..87cb12b9846 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -5,27 +5,14 @@ #include <stdio.h> #include <stdlib.h> #include <math.h> -#include <GL/glut.h> #ifndef WIN32 #include <unistd.h> #include <signal.h> -#define GL_GLEXT_PROTOTYPES -#else -#include <GL/glext.h> #endif -#ifdef WIN32 -static PFNGLBINDPROGRAMARBPROC glBindProgramARB = NULL; -static PFNGLGENPROGRAMSARBPROC glGenProgramsARB = NULL; -static PFNGLPROGRAMSTRINGARBPROC glProgramStringARB = NULL; -static PFNGLISPROGRAMARBPROC glIsProgramARB = NULL; - -static PFNGLBINDPROGRAMNVPROC glBindProgramNV = NULL; -static PFNGLGENPROGRAMSNVPROC glGenProgramsNV = NULL; -static PFNGLLOADPROGRAMNVPROC glLoadProgramNV = NULL; -static PFNGLISPROGRAMNVPROC glIsProgramNV = NULL; -#endif +#include <GL/glew.h> +#include <GL/glut.h> static const char *filename = NULL; static GLuint nr_steps = 4; @@ -114,13 +101,6 @@ static void Init( void ) fprintf(stderr, "%.*s\n", sz, buf); if (strncmp( buf, "!!VP", 4 ) == 0) { -#ifdef WIN32 - glBindProgramNV = (PFNGLBINDPROGRAMNVPROC) wglGetProcAddress( "glBindProgramNV" ); - glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC) wglGetProcAddress( "glGenProgramsNV" ); - glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC) wglGetProcAddress( "glLoadProgramNV" ); - glIsProgramNV = (PFNGLISPROGRAMNVPROC) wglGetProcAddress( "glIsProgramNV" ); -#endif - glEnable( GL_VERTEX_PROGRAM_NV ); glGenProgramsNV( 1, &prognum ); glBindProgramNV( GL_VERTEX_PROGRAM_NV, prognum ); @@ -128,13 +108,6 @@ static void Init( void ) assert( glIsProgramNV( prognum ) ); } else { -#ifdef WIN32 - glBindProgramARB = (PFNGLBINDPROGRAMARBPROC) wglGetProcAddress( "glBindProgramARB" ); - glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC) wglGetProcAddress( "glGenProgramsARB" ); - glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC) wglGetProcAddress( "glProgramStringARB" ); - glIsProgramARB = (PFNGLISPROGRAMARBPROC) wglGetProcAddress( "glIsProgramARB" ); -#endif - glEnable(GL_VERTEX_PROGRAM_ARB); glGenProgramsARB(1, &prognum); @@ -287,6 +260,7 @@ int main( int argc, char *argv[] ) glutInitWindowSize( 250, 250 ); glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH ); glutCreateWindow(argv[argc-1]); + glewInit(); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); glutDisplayFunc( Display ); |