Commit 8d930f60 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Restore the gamma when destroying the swapchain.

parent 2d4d18b5
...@@ -1599,6 +1599,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic ...@@ -1599,6 +1599,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
object->wantsDepthStencilBuffer = FALSE; object->wantsDepthStencilBuffer = FALSE;
} }
IWineD3DSwapChain_GetGammaRamp((IWineD3DSwapChain *) object, &object->orig_gamma);
TRACE("Created swapchain %p\n", object); TRACE("Created swapchain %p\n", object);
TRACE("FrontBuf @ %p, BackBuf @ %p, DepthStencil %d\n",object->frontBuffer, object->backBuffer ? object->backBuffer[0] : NULL, object->wantsDepthStencilBuffer); TRACE("FrontBuf @ %p, BackBuf @ %p, DepthStencil %d\n",object->frontBuffer, object->backBuffer ? object->backBuffer[0] : NULL, object->wantsDepthStencilBuffer);
return WINED3D_OK; return WINED3D_OK;
......
...@@ -88,6 +88,10 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB ...@@ -88,6 +88,10 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB
WINED3DDISPLAYMODE mode; WINED3DDISPLAYMODE mode;
int i; int i;
TRACE("Destroying swapchain %p\n", iface);
IWineD3DSwapChain_SetGammaRamp(iface, 0, &This->orig_gamma);
/* release the ref to the front and back buffer parents */ /* release the ref to the front and back buffer parents */
if(This->frontBuffer) { if(This->frontBuffer) {
IWineD3DSurface_SetContainer(This->frontBuffer, 0); IWineD3DSurface_SetContainer(This->frontBuffer, 0);
......
...@@ -1698,6 +1698,7 @@ typedef struct IWineD3DSwapChainImpl ...@@ -1698,6 +1698,7 @@ typedef struct IWineD3DSwapChainImpl
WINED3DPRESENT_PARAMETERS presentParms; WINED3DPRESENT_PARAMETERS presentParms;
DWORD orig_width, orig_height; DWORD orig_width, orig_height;
WINED3DFORMAT orig_fmt; WINED3DFORMAT orig_fmt;
WINED3DGAMMARAMP orig_gamma;
long prev_time, frames; /* Performance tracking */ long prev_time, frames; /* Performance tracking */
unsigned int vSyncCounter; unsigned int vSyncCounter;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment