mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Add error checking in VBO::load().
VertexBuffer should now be able to fall back to vertex arrays if glBufferDataARB() fails (possible due to lack of memory).
This commit is contained in:
@@ -195,13 +195,15 @@ namespace opengl
|
||||
const GLvoid *src = restore ? buffer_copy : 0;
|
||||
|
||||
// Note that if 'src' is '0', no data will be copied.
|
||||
glGetError();
|
||||
glBufferDataARB(getTarget(), getSize(), src, getUsage());
|
||||
GLenum err = glGetError();
|
||||
|
||||
// Clean up buffer_copy, if it exists.
|
||||
delete[] buffer_copy;
|
||||
buffer_copy = 0;
|
||||
|
||||
return true;
|
||||
return (GL_NO_ERROR != err);
|
||||
}
|
||||
|
||||
void VBO::unload(bool save)
|
||||
|
||||
Reference in New Issue
Block a user