Alexandre Julliard : gdi32: Update the DC in most OpenGL functions.

Alexandre Julliard julliard at winehq.org
Tue Sep 18 05:30:59 CDT 2007


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Sep 17 16:56:56 2007 +0200

gdi32: Update the DC in most OpenGL functions.

---

 dlls/gdi32/opengl.c   |   18 ++++++++++--------
 dlls/gdi32/painting.c |   10 ++++++----
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/dlls/gdi32/opengl.c b/dlls/gdi32/opengl.c
index 137349d..164f279 100644
--- a/dlls/gdi32/opengl.c
+++ b/dlls/gdi32/opengl.c
@@ -65,16 +65,17 @@ static DC* OPENGL_GetDefaultDC(void)
 HGLRC WINAPI wglCreateContext(HDC hdc)
 {
     HGLRC ret = 0;
-    DC * dc = DC_GetDCPtr( hdc );
+    DC * dc = get_dc_ptr( hdc );
 
     TRACE("(%p)\n",hdc);
 
     if (!dc) return 0;
 
+    update_dc( dc );
     if (!dc->funcs->pwglCreateContext) FIXME(" :stub\n");
     else ret = dc->funcs->pwglCreateContext(dc->physDev);
 
-    DC_ReleaseDCPtr( dc );
+    release_dc_ptr( dc );
     return ret;
 }
 
@@ -195,21 +196,22 @@ static BOOL WINAPI wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGLRC hglr
     TRACE("hDrawDC: (%p), hReadDC: (%p) hglrc: (%p)\n", hDrawDC, hReadDC, hglrc);
 
     /* Both hDrawDC and hReadDC need to be valid */
-    DrawDC = DC_GetDCPtr( hDrawDC);
+    DrawDC = get_dc_ptr( hDrawDC );
     if (!DrawDC) return FALSE;
 
-    ReadDC = DC_GetDCPtr( hReadDC);
+    ReadDC = get_dc_ptr( hReadDC );
     if (!ReadDC) {
-        DC_ReleaseDCPtr(DrawDC);
+        release_dc_ptr( DrawDC );
         return FALSE;
     }
 
+    update_dc( DrawDC );
+    update_dc( ReadDC );
     if (!DrawDC->funcs->pwglMakeContextCurrentARB) FIXME(" :stub\n");
     else ret = DrawDC->funcs->pwglMakeContextCurrentARB(DrawDC->physDev, ReadDC->physDev, hglrc);
 
-    DC_ReleaseDCPtr(DrawDC);
-    DC_ReleaseDCPtr(ReadDC);
-
+    release_dc_ptr( DrawDC );
+    release_dc_ptr( ReadDC );
     return ret;
 }
 
diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c
index 987510f..1b8d6aa 100644
--- a/dlls/gdi32/painting.c
+++ b/dlls/gdi32/painting.c
@@ -394,16 +394,17 @@ BOOL WINAPI SetPixelFormat( HDC hdc, INT iPixelFormat,
 INT WINAPI GetPixelFormat( HDC hdc )
 {
     INT ret = 0;
-    DC * dc = DC_GetDCPtr( hdc );
+    DC * dc = get_dc_ptr( hdc );
 
     TRACE("(%p)\n",hdc);
 
     if (!dc) return 0;
 
+    update_dc( dc );
     if (!dc->funcs->pGetPixelFormat) FIXME(" :stub\n");
     else ret = dc->funcs->pGetPixelFormat(dc->physDev);
 
-    DC_ReleaseDCPtr( dc );
+    release_dc_ptr( dc );
     return ret;
 }
 
@@ -460,12 +461,13 @@ INT WINAPI DescribePixelFormat( HDC hdc, INT iPixelFormat, UINT nBytes,
 BOOL WINAPI SwapBuffers( HDC hdc )
 {
     INT bRet = FALSE;
-    DC * dc = DC_GetDCPtr( hdc );
+    DC * dc = get_dc_ptr( hdc );
 
     TRACE("(%p)\n",hdc);
 
     if (!dc) return TRUE;
 
+    update_dc( dc );
     if (!dc->funcs->pSwapBuffers)
     {
         FIXME(" :stub\n");
@@ -473,7 +475,7 @@ BOOL WINAPI SwapBuffers( HDC hdc )
     }
     else bRet = dc->funcs->pSwapBuffers(dc->physDev);
 
-    DC_ReleaseDCPtr( dc );
+    release_dc_ptr( dc );
     return bRet;
 }
 




More information about the wine-cvs mailing list