Stefan Dösinger : wined3d: Avoid loading opengl32.dll.

Alexandre Julliard julliard at winehq.org
Tue Dec 16 08:40:56 CST 2008


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Sun Nov 23 12:43:15 2008 +0100

wined3d: Avoid loading opengl32.dll.

This confuses applications like Steam, which hook d3d9 and opengl
functions. It sees that the application uses opengl32, but it doesn't
realize that d3d9 is wrapped to opengl. Thus it starts messing around
with wined3d's wgl context. It usually tries to draw geometry with the
context, but cannot deal with some of the obscure extensions we have
activated.

---

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

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 32e46c9..d8ec3ef 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4157,7 +4157,7 @@ static void fillGLAttribFuncs(const WineD3D_GL_Info *gl_info)
 
 #define PUSH1(att)        attribs[nAttribs++] = (att);
 BOOL InitAdapters(void) {
-    static HMODULE mod_gl, mod_win32gl;
+    static HMODULE mod_gl;
     BOOL ret;
     int ps_selected_mode, vs_selected_mode;
 
@@ -4181,11 +4181,6 @@ BOOL InitAdapters(void) {
 #define USE_GL_FUNC(pfn) pfn = (void*)pwglGetProcAddress(#pfn);
         /* To bypass the opengl32 thunks load wglGetProcAddress from gdi32 (glXGetProcAddress wrapper) instead of opengl32's */
         mod_gl = GetModuleHandleA("gdi32.dll");
-        mod_win32gl = LoadLibraryA("opengl32.dll");
-        if(!mod_win32gl) {
-            ERR("Can't load opengl32.dll!\n");
-            goto nogl_adapter;
-        }
 #endif
     }
 
@@ -4206,8 +4201,13 @@ BOOL InitAdapters(void) {
     /* Load glFinish and glFlush from opengl32.dll even if we're not using WIN32 opengl
      * otherwise because we have to use winex11.drv's override
      */
-    glFinish = (void*)GetProcAddress(mod_win32gl, "glFinish");
-    glFlush = (void*)GetProcAddress(mod_win32gl, "glFlush");
+#ifdef USE_WIN32_OPENGL
+    glFinish = (void*)GetProcAddress(mod_gl, "glFinish");
+    glFlush = (void*)GetProcAddress(mod_gl, "glFlush");
+#else
+    glFinish = (void*)pwglGetProcAddress("wglFinish");
+    glFlush = (void*)pwglGetProcAddress("wglFlush");
+#endif
 
     /* For now only one default adapter */
     {




More information about the wine-cvs mailing list