wined3d: Restore the gamma when destroying the swapchain.

This commit is contained in:
Stefan Dösinger 2008-07-01 11:17:38 -05:00 committed by Alexandre Julliard
parent 2d4d18b59d
commit 8d930f6009
3 changed files with 7 additions and 0 deletions

View File

@ -1599,6 +1599,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
object->wantsDepthStencilBuffer = FALSE;
}
IWineD3DSwapChain_GetGammaRamp((IWineD3DSwapChain *) object, &object->orig_gamma);
TRACE("Created swapchain %p\n", object);
TRACE("FrontBuf @ %p, BackBuf @ %p, DepthStencil %d\n",object->frontBuffer, object->backBuffer ? object->backBuffer[0] : NULL, object->wantsDepthStencilBuffer);
return WINED3D_OK;

View File

@ -88,6 +88,10 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB
WINED3DDISPLAYMODE mode;
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 */
if(This->frontBuffer) {
IWineD3DSurface_SetContainer(This->frontBuffer, 0);

View File

@ -1698,6 +1698,7 @@ typedef struct IWineD3DSwapChainImpl
WINED3DPRESENT_PARAMETERS presentParms;
DWORD orig_width, orig_height;
WINED3DFORMAT orig_fmt;
WINED3DGAMMARAMP orig_gamma;
long prev_time, frames; /* Performance tracking */
unsigned int vSyncCounter;