From 9aa73cfae84c7710df97ce182d32bea8d3423ab7 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sun, 1 Feb 2009 12:00:07 +0000 Subject: progs: Get more samples building on windows. --- progs/demos/winpos.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'progs/demos/winpos.c') diff --git a/progs/demos/winpos.c b/progs/demos/winpos.c index b58e330864..13a9c7e9a8 100644 --- a/progs/demos/winpos.c +++ b/progs/demos/winpos.c @@ -11,7 +11,7 @@ #ifdef _WIN32 #include #endif -#define GL_GLEXT_PROTOTYPES +#include "GL/glew.h" #include "GL/glut.h" #include "readtex.h" @@ -29,8 +29,7 @@ static GLubyte *Image; static int ImgWidth, ImgHeight; static GLenum ImgFormat; -typedef void (APIENTRY * PFNWINDOWPOSFUNC)(GLfloat x, GLfloat y); -static PFNWINDOWPOSFUNC WindowPosFunc; +static PFNGLWINDOWPOS2FPROC WindowPosFunc; static void draw( void ) { @@ -71,19 +70,16 @@ static void reshape( int width, int height ) static void init( void ) { -#ifdef GL_ARB_window_pos - if (glutExtensionSupported("GL_ARB_window_pos")) { + if (GLEW_ARB_window_pos) { printf("Using GL_ARB_window_pos\n"); - WindowPosFunc = &glWindowPos2fARB; + WindowPosFunc = glWindowPos2fARB; } else -#elif defined(GL_MESA_window_pos) - if (glutExtensionSupported("GL_MESA_window_pos")) { + if (GLEW_MESA_window_pos) { printf("Using GL_MESA_window_pos\n"); - WindowPosFunc = &glWindowPos2fMESA; + WindowPosFunc = glWindowPos2fMESA; } else -#endif { printf("Sorry, GL_ARB/MESA_window_pos extension not available.\n"); exit(1); @@ -109,6 +105,8 @@ int main( int argc, char *argv[] ) exit(0); } + glewInit(); + init(); glutReshapeFunc( reshape ); -- cgit v1.2.3