Stefan Dösinger : wined3d: Make it clear that glFlush and glFinish are WGL functions.

Alexandre Julliard julliard at winehq.org
Wed Aug 26 10:45:22 CDT 2009


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

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Wed Aug 26 11:44:34 2009 +0200

wined3d: Make it clear that glFlush and glFinish are WGL functions.

---

 dlls/wined3d/device.c     |    4 ++--
 dlls/wined3d/directx.c    |   10 +++++-----
 dlls/wined3d/surface.c    |    4 ++--
 dlls/wined3d/wined3d_gl.h |    9 ++++++---
 4 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index c17d7b6..00a4c96 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4854,7 +4854,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_EndScene(IWineD3DDevice *iface) {
 
     ActivateContext(This, NULL, CTXUSAGE_RESOURCELOAD);
     /* We only have to do this if we need to read the, swapbuffers performs a flush for us */
-    glFlush();
+    wglFlush();
     /* No checkGLcall here to avoid locking the lock just for checking a call that hardly ever
      * fails
      */
@@ -5067,7 +5067,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This,  IWineD3DSurfa
 
     if (SUCCEEDED(IWineD3DSurface_GetContainer((IWineD3DSurface *)target, &IID_IWineD3DSwapChain, (void **)&swapchain))) {
         if (target == (IWineD3DSurfaceImpl*) swapchain->frontBuffer) {
-            glFlush();
+            wglFlush();
         }
         IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain);
     }
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 3d287f0..64f04fc 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -576,7 +576,7 @@ static void test_pbo_functionality(struct wined3d_gl_info *gl_info)
     checkGLcall("Loading the PBO test texture");
 
     GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
-    glFinish(); /* just to be sure */
+    wglFinish(); /* just to be sure */
 
     memset(check, 0, sizeof(check));
     glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, check);
@@ -4646,11 +4646,11 @@ BOOL InitAdapters(IWineD3DImpl *This)
      * otherwise because we have to use winex11.drv's override
      */
 #ifdef USE_WIN32_OPENGL
-    glFinish = (void*)GetProcAddress(mod_gl, "glFinish");
-    glFlush = (void*)GetProcAddress(mod_gl, "glFlush");
+    wglFinish = (void*)GetProcAddress(mod_gl, "glFinish");
+    wglFlush = (void*)GetProcAddress(mod_gl, "glFlush");
 #else
-    glFinish = (void*)pwglGetProcAddress("wglFinish");
-    glFlush = (void*)pwglGetProcAddress("wglFlush");
+    wglFinish = (void*)pwglGetProcAddress("wglFinish");
+    wglFlush = (void*)pwglGetProcAddress("wglFlush");
 #endif
 
     glEnableWINE = glEnable;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 82612a3..6705449 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3814,7 +3814,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
 
         /* Flush in case the drawable is used by multiple GL contexts */
         if(dstSwapchain && (This == (IWineD3DSurfaceImpl *) dstSwapchain->frontBuffer || dstSwapchain->num_contexts >= 2))
-            glFlush();
+            wglFlush();
 
         /* TODO: If the surface is locked often, perform the Blt in software on the memory instead */
         /* The surface is now in the drawable. On onscreen surfaces or without fbos the texture
@@ -4680,7 +4680,7 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT
         /* Make sure to flush the buffers. This is needed in apps like Red Alert II and Tiberian SUN that use multiple WGL contexts. */
         if(((IWineD3DSwapChainImpl*)swapchain)->frontBuffer == (IWineD3DSurface*)This ||
            ((IWineD3DSwapChainImpl*)swapchain)->num_contexts >= 2)
-            glFlush();
+            wglFlush();
 
         IWineD3DSwapChain_Release(swapchain);
     } else {
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index 8ff55b0..f5f5e18 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -1141,10 +1141,13 @@ void (WINE_GLAPI *glViewport) (GLint x, GLint y, GLsizei width, GLsizei height);
 void (WINE_GLAPI *glPointParameterfv) (GLenum pname, const GLfloat *params);
 
 /* glFinish and glFlush are always loaded from opengl32.dll, thus they always have
- * __stdcall calling convention
+ * __stdcall calling convention.
+ *
+ * They are wgl functions and must not be called inside the gl lock, give them a
+ * name that makes this clear
  */
-void (__stdcall  *glFinish) ();
-void (__stdcall  *glFlush) ();
+void (__stdcall  *wglFinish) ();
+void (__stdcall  *wglFlush) ();
 
 /* WGL functions */
 HGLRC   (WINAPI *pwglCreateContext)(HDC);




More information about the wine-cvs mailing list