summaryrefslogtreecommitdiff
path: root/progs/demos/winpos.c
diff options
context:
space:
mode:
Diffstat (limited to 'progs/demos/winpos.c')
-rw-r--r--progs/demos/winpos.c18
1 files changed, 8 insertions, 10 deletions
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 <windows.h>
#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 );