diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-02-10 11:36:48 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-02-10 11:51:46 +0000 |
commit | 5b0807b72f16a4835e4b28aa8a66e9bcd867d383 (patch) | |
tree | 32e803e6bb4a7390b005d6d5a3f2d8ef61af25c5 /src/glut/glx | |
parent | aeed92952efaac0b3519aeb141de18e17f0f454c (diff) |
glut: Use the official WGL functions.
Especially using wglGetPixelFormat instead of GetPixelFormat causes
problems with opengl32.dll and drivers that not hack around this issue.
Diffstat (limited to 'src/glut/glx')
-rw-r--r-- | src/glut/glx/SConscript | 1 | ||||
-rw-r--r-- | src/glut/glx/glutint.h | 38 | ||||
-rw-r--r-- | src/glut/glx/win32_glx.c | 2 |
3 files changed, 9 insertions, 32 deletions
diff --git a/src/glut/glx/SConscript b/src/glut/glx/SConscript index cb442ba027..938fec03df 100644 --- a/src/glut/glx/SConscript +++ b/src/glut/glx/SConscript @@ -10,7 +10,6 @@ target = 'glut32' env.Replace(CPPDEFINES = [ 'BUILD_GLUT32', 'GLUT_BUILDING_LIB', - 'MESA', 'NDEBUG', 'GLUT_NO_WARNING_DISABLE', ]) diff --git a/src/glut/glx/glutint.h b/src/glut/glx/glutint.h index fe4e038add..ba30af60f0 100644 --- a/src/glut/glx/glutint.h +++ b/src/glut/glx/glutint.h @@ -32,10 +32,6 @@ #include <GL/glut.h> -#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__) -#include <GL/mesa_wgl.h> -#endif - #ifndef _WIN32 /* added by BrianP: */ #ifndef APIENTRY @@ -48,24 +44,6 @@ /* GLUT_BUILDING_LIB is used by <GL/glut.h> to 1) not #pragma link with the GLUT library, and 2) avoid the Win32 atexit hack. */ -/* This must be done after <GL/gl.h> is included. MESA is defined - if the <GL/gl.h> is supplied by Brian Paul's Mesa library. */ -#if defined(MESA) && defined(_WIN32) -/* Mesa implements "wgl" versions of GDI entry points needed for - using OpenGL. Map these "wgl" versions to the GDI names via - macros. */ -#define ChoosePixelFormat wglChoosePixelFormat -#define DescribePixelFormat wglDescribePixelFormat -#define GetPixelFormat wglGetPixelFormat -#define SetPixelFormat wglSetPixelFormat -#define SwapBuffers wglSwapBuffers -#define GetCurrentContext wglGetCurrentContext -#define GetCurrentDC wglGetCurrentDC -#define MakeCurrent wglMakeCurrent -#define CreateContext wglCreateContext -#define DeleteContext wglDeleteContext -#endif /* MESA */ - #ifdef SUPPORT_FORTRAN #include <GL/glutf90.h> #endif @@ -572,27 +550,27 @@ typedef struct { #ifdef _WIN32 #define MAKE_CURRENT_LAYER(window) \ { \ - HGLRC currentContext = GetCurrentContext(); \ - HDC currentDc = GetCurrentDC(); \ + HGLRC currentContext = wglGetCurrentContext(); \ + HDC currentDc = wglGetCurrentDC(); \ \ if (currentContext != window->renderCtx \ || currentDc != window->renderDc) { \ - MakeCurrent(window->renderDc, window->renderCtx); \ + wglMakeCurrent(window->renderDc, window->renderCtx); \ } \ } #define MAKE_CURRENT_WINDOW(window) \ { \ - HGLRC currentContext = GetCurrentContext(); \ - HDC currentDc = GetCurrentDC(); \ + HGLRC currentContext = wglGetCurrentContext(); \ + HDC currentDc = wglGetCurrentDC(); \ \ if (currentContext != window->ctx || currentDc != window->hdc) { \ - MakeCurrent(window->hdc, window->ctx); \ + wglMakeCurrent(window->hdc, window->ctx); \ } \ } #define MAKE_CURRENT_OVERLAY(overlay) \ - MakeCurrent(overlay->hdc, overlay->ctx) + wglMakeCurrent(overlay->hdc, overlay->ctx) #define UNMAKE_CURRENT() \ - MakeCurrent(NULL, NULL) + wglMakeCurrent(NULL, NULL) #define SWAP_BUFFERS_WINDOW(window) \ SwapBuffers(window->hdc) #define SWAP_BUFFERS_LAYER(window) \ diff --git a/src/glut/glx/win32_glx.c b/src/glut/glx/win32_glx.c index ecfff44b93..3522e606ec 100644 --- a/src/glut/glx/win32_glx.c +++ b/src/glut/glx/win32_glx.c @@ -22,7 +22,7 @@ glXCreateContext(Display * display, XVisualInfo * visinfo, routine. */ HGLRC context; - context = CreateContext(XHDC); + context = wglCreateContext(XHDC); #if 0 /* XXX GLUT doesn't support it now, so don't worry about display list |