Module: wine Branch: master Commit: 38a4f6339b75528334abb808c426555d0f29b9d4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=38a4f6339b75528334abb808c4...
Author: Stefan Dösinger stefan@codeweavers.com Date: Tue Jan 8 15:40:35 2008 +0100
wined3d: Implement IWineD3DCubeTexture::UnLoad.
---
dlls/wined3d/cubetexture.c | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index 8560ab0..6704b17 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -159,7 +159,29 @@ static void WINAPI IWineD3DCubeTextureImpl_PreLoad(IWineD3DCubeTexture *iface) { }
static void WINAPI IWineD3DCubeTextureImpl_UnLoad(IWineD3DCubeTexture *iface) { - IWineD3DResourceImpl_UnLoad((IWineD3DResource *)iface); + unsigned int i, j; + IWineD3DCubeTextureImpl *This = (IWineD3DCubeTextureImpl *)iface; + IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; + TRACE("(%p)\n", This); + + /* Unload all the surfaces and reset the texture name. If UnLoad was called on the + * surface before, this one will be a NOP and vice versa. Unloading an unloaded + * surface is fine + */ + for (i = 0; i < This->baseTexture.levels; i++) { + for (j = WINED3DCUBEMAP_FACE_POSITIVE_X; j <= WINED3DCUBEMAP_FACE_NEGATIVE_Z ; j++) { + IWineD3DSurface_UnLoad(This->surfaces[j][i]); + IWineD3DSurface_SetGlTextureDesc(This->surfaces[j][i], 0, IWineD3DTexture_GetTextureDimensions(iface)); + } + } + + if(This->baseTexture.textureName) { + ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); + ENTER_GL(); + glDeleteTextures(1, &This->baseTexture.textureName); + This->baseTexture.textureName = 0; + LEAVE_GL(); + } }
static WINED3DRESOURCETYPE WINAPI IWineD3DCubeTextureImpl_GetType(IWineD3DCubeTexture *iface) {