Stefan Dösinger : wined3d: Implement VolumeTexture:: UnLoad.
Alexandre Julliard
julliard at winehq.org
Mon Jan 14 09:33:21 CST 2008
Module: wine
Branch: master
Commit: 8bb5d13fe2d01cd1c3486701e7f7404f1febabf7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8bb5d13fe2d01cd1c3486701e7f7404f1febabf7
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Tue Jan 8 15:48:39 2008 +0100
wined3d: Implement VolumeTexture::UnLoad.
---
dlls/wined3d/volumetexture.c | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c
index b2b3d2d..61c2626 100644
--- a/dlls/wined3d/volumetexture.c
+++ b/dlls/wined3d/volumetexture.c
@@ -136,7 +136,26 @@ static void WINAPI IWineD3DVolumeTextureImpl_PreLoad(IWineD3DVolumeTexture *ifac
}
static void WINAPI IWineD3DVolumeTextureImpl_UnLoad(IWineD3DVolumeTexture *iface) {
- IWineD3DResourceImpl_UnLoad((IWineD3DResource *)iface);
+ unsigned int i;
+ IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)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++) {
+ IWineD3DVolume_UnLoad(This->volumes[i]);
+ }
+
+ 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 IWineD3DVolumeTextureImpl_GetType(IWineD3DVolumeTexture *iface) {
More information about the wine-cvs
mailing list