[PATCH] CreateContext should not be called between ENTER_GL/LEAVE_GL. It now has its own ENTER_GL/LEAVE_GL code for the GL calls it makes. The swapchain present code only calls ENTER_GL/LEAVE_GL for the single GL call it makes and doesn't call CreateContext between ENTER_GL/LEAVE_GL anymore.

Roderick Colenbrander thunderbird2k at gmx.net
Sat Sep 29 09:58:44 CDT 2007


---
 dlls/wined3d/context.c   |    2 ++
 dlls/wined3d/device.c    |    3 ---
 dlls/wined3d/swapchain.c |    5 ++---
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 403acdf..776b20d 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -324,6 +324,7 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
         goto out;
     }
 
+    ENTER_GL();
     TRACE("Setting up the screen\n");
     /* Clear the screen */
     glClearColor(1.0, 0.0, 0.0, 0.0);
@@ -389,6 +390,7 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
             checkGLcall("glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)\n");
         }
     }
+    LEAVE_GL();
 
     if(oldDrawable && oldCtx) {
         pwglMakeCurrent(oldDrawable, oldCtx);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 9cf8ab1..082a13f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1456,10 +1456,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
 	return E_OUTOFMEMORY;
     object->num_contexts = 1;
 
-    ENTER_GL();
     object->context[0] = CreateContext(This, (IWineD3DSurfaceImpl *) object->frontBuffer, object->win_handle, FALSE /* pbuffer */, pPresentationParameters);
-    LEAVE_GL();
-
     if (!object->context[0]) {
         ERR("Failed to create a new context\n");
         hr = WINED3DERR_NOTAVAILABLE;
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 4ecab95..e302f56 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -132,7 +132,6 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
 
 
     ActivateContext(This->wineD3DDevice, This->backBuffer[0], CTXUSAGE_RESOURCELOAD);
-    ENTER_GL();
 
     /* Render the cursor onto the back buffer, using our nifty directdraw blitting code :-) */
     if(This->wineD3DDevice->bCursorVisible && This->wineD3DDevice->cursorTexture) {
@@ -244,7 +243,9 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
 #if defined(SHOW_FRAME_MAKEUP)
             FIXME("Singe Frame snapshots Starting\n");
             isDumpingFrames = TRUE;
+            ENTER_GL();
             glClear(GL_COLOR_BUFFER_BIT);
+            LEAVE_GL();
 #endif
 
 #if defined(SINGLE_FRAME_DEBUGGING)
@@ -272,8 +273,6 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
 }
 #endif
 
-    LEAVE_GL();
-
     if (This->presentParms.SwapEffect == WINED3DSWAPEFFECT_DISCARD) {
         TRACE("Clearing the color buffer with pink color\n");
 
-- 
1.5.1.3


--========GMX259291191079373823867--



More information about the wine-patches mailing list