wined3d: Implement IWineD3DIndexBuffer::UnLoad.

This commit is contained in:
Stefan Dösinger 2008-01-12 22:57:49 +01:00 committed by Alexandre Julliard
parent 15245a74b6
commit 36729a874c
1 changed files with 18 additions and 1 deletions

View File

@ -111,7 +111,24 @@ static void WINAPI IWineD3DIndexBufferImpl_PreLoad(IWineD3DIndexBuffer *iface) {
}
static void WINAPI IWineD3DIndexBufferImpl_UnLoad(IWineD3DIndexBuffer *iface) {
IWineD3DResourceImpl_UnLoad((IWineD3DResource *)iface);
IWineD3DIndexBufferImpl *This = (IWineD3DIndexBufferImpl *) iface;
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
TRACE("(%p)\n", This);
/* This is easy: The whole content is shadowed in This->resource.allocatedMemory,
* so we only have to destroy the vbo. Only do it if we have a vbo, which implies
* that vbos are supported.
* (TODO: Make a IWineD3DBuffer base class for index and vertex buffers and share
* this code. Also needed for D3D10)
*/
if(This->vbo) {
ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
ENTER_GL();
GL_EXTCALL(glDeleteBuffersARB(1, &This->vbo));
checkGLcall("glDeleteBuffersARB");
LEAVE_GL();
This->vbo = 0;
}
}
static WINED3DRESOURCETYPE WINAPI IWineD3DIndexBufferImpl_GetType(IWineD3DIndexBuffer *iface) {