Commit 36729a87 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Implement IWineD3DIndexBuffer::UnLoad.

parent 15245a74
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment