wined3d: Tear down the dummy textures before resetting.

In theory the opengl library should release the gl resources when we
destroy the context, and the stateblock reset will recreate the dummy
textures, but I think it is cleaner to do this explicitly.
oldstable
Stefan Dösinger 2008-02-05 21:56:46 +01:00 committed by Alexandre Julliard
parent 564532f026
commit cb6de00c86
1 changed files with 10 additions and 2 deletions

View File

@ -6777,6 +6777,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
WINED3DDISPLAYMODE mode;
IWineD3DBaseShaderImpl *shader;
IWineD3DSurfaceImpl *target;
UINT i;
TRACE("(%p)\n", This);
hr = IWineD3DDevice_GetSwapChain(iface, 0, (IWineD3DSwapChain **) &swapchain);
@ -6839,14 +6840,21 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
This->shader_backend->shader_destroy((IWineD3DBaseShader *) shader);
}
ENTER_GL();
if(This->depth_blt_texture) {
ENTER_GL();
glDeleteTextures(1, &This->depth_blt_texture);
LEAVE_GL();
This->depth_blt_texture = 0;
}
This->shader_backend->shader_destroy_depth_blt(iface);
for (i = 0; i < GL_LIMITS(textures); i++) {
/* The stateblock initialization below will recreate them */
glDeleteTextures(1, &This->dummyTextureName[i]);
checkGLcall("glDeleteTextures(1, &This->dummyTextureName[i])");
This->dummyTextureName[i] = 0;
}
LEAVE_GL();
while(This->numContexts) {
DestroyContext(This, This->contexts[0]);
}