Roderick Colenbrander : wined3d: Load wglGetProcAddress from opengl32. dll instead of gdi32.dll when USE_WIN32_OPENGL is defined.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 15 04:34:01 CDT 2007


Module: wine
Branch: master
Commit: 3d58a065dfd0ceb7cf87c106a007d0819a857fc9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3d58a065dfd0ceb7cf87c106a007d0819a857fc9

Author: Roderick Colenbrander <thunderbird2k at gmx.net>
Date:   Tue Aug 14 15:08:20 2007 +0200

wined3d: Load wglGetProcAddress from opengl32.dll instead of gdi32.dll when USE_WIN32_OPENGL is defined.

---

 dlls/wined3d/directx.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 22487bc..bef0c3f 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -414,12 +414,22 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) {
 
     TRACE_(d3d_caps)("(%p)\n", gl_info);
 
+#ifdef USE_WIN32_OPENGL
+#define USE_GL_FUNC(pfn) pfn = (void*)GetProcAddress(mod_gl, (const char *) #pfn);
+    mod_gl = LoadLibraryA("opengl32.dll");
+    if(!mod_gl) {
+        ERR("Can't load opengl32.dll!\n");
+        return FALSE;
+    }
+#else
+#define USE_GL_FUNC(pfn) pfn = (void*)p_wglGetProcAddress( (const char *) #pfn);
     /* To bypass the opengl32 thunks load wglGetProcAddress from gdi32 (glXGetProcAddress wrapper) instead of opengl32's */
     mod_gl = LoadLibraryA("gdi32.dll");
     if(!mod_gl) {
         ERR("Can't load gdi32.dll!\n");
         return FALSE;
     }
+#endif
 
     p_wglGetProcAddress = (void*)GetProcAddress(mod_gl, "wglGetProcAddress");
     if(!p_wglGetProcAddress) {
@@ -428,7 +438,6 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) {
     }
 
 /* Dynamicly load all GL core functions */
-#define USE_GL_FUNC(pfn) pfn = (void*)p_wglGetProcAddress( (const char *) #pfn);
     GL_FUNCS_GEN;
 #undef USE_GL_FUNC
 




More information about the wine-cvs mailing list