summaryrefslogtreecommitdiff
path: root/progs/demos/winpos.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-02-01 12:00:07 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-02-01 12:00:17 +0000
commit9aa73cfae84c7710df97ce182d32bea8d3423ab7 (patch)
tree07c1e2cf4938aff49ae73950eb4c197e6bd38bb8 /progs/demos/winpos.c
parent7062b7c7cb32c3c96bb87b296d9df0ecae7e7c83 (diff)
progs: Get more samples building on windows.
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 );