wined3d: Index buffer creation adjustments.

Index buffer creation changes the bound gl buffer, thus the state has to
be dirtified, similar to locking.
In an error case the function returned without calling LEAVE_GL().
This commit is contained in:
Stefan Dösinger 2007-02-26 13:38:17 +01:00 committed by Alexandre Julliard
parent 76ed11e180
commit 74d2632756
1 changed files with 6 additions and 2 deletions

View File

@ -447,6 +447,11 @@ static void CreateIndexBufferVBO(IWineD3DDeviceImpl *This, IWineD3DIndexBufferIm
GLenum error, glUsage; GLenum error, glUsage;
TRACE("Creating VBO for Index Buffer %p\n", object); TRACE("Creating VBO for Index Buffer %p\n", object);
/* The following code will modify the ELEMENT_ARRAY_BUFFER binding, make sure it is
* restored on the next draw
*/
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_INDEXBUFFER);
ENTER_GL(); ENTER_GL();
while(glGetError()); while(glGetError());
@ -454,8 +459,7 @@ static void CreateIndexBufferVBO(IWineD3DDeviceImpl *This, IWineD3DIndexBufferIm
error = glGetError(); error = glGetError();
if(error != GL_NO_ERROR || object->vbo == 0) { if(error != GL_NO_ERROR || object->vbo == 0) {
ERR("Creating a vbo failed, continueing without vbo for this buffer\n"); ERR("Creating a vbo failed, continueing without vbo for this buffer\n");
object->vbo = 0; goto out;
return;
} }
GL_EXTCALL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, object->vbo)); GL_EXTCALL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, object->vbo));