Roderick Colenbrander : wined3d: CreateContext should not be called between ENTER_GL/LEAVE_GL.
Alexandre Julliard
julliard at winehq.org
Mon Oct 1 07:54:59 CDT 2007
Module: wine
Branch: master
Commit: 001f380ac96aaca280f37c29d8e320a6054f10ec
URL: http://source.winehq.org/git/wine.git/?a=commit;h=001f380ac96aaca280f37c29d8e320a6054f10ec
Author: Roderick Colenbrander <thunderbird2k at gmx.net>
Date: Sat Sep 29 16:58:44 2007 +0200
wined3d: CreateContext should not be called between ENTER_GL/LEAVE_GL.
---
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");
More information about the wine-cvs
mailing list