Browse Source

Make sure all error flags are cleared before calling glBufferDataARB() in VBO::load().

vrld 13 years ago
parent
commit
febd7757fc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/modules/graphics/opengl/VertexBuffer.cpp

+ 3 - 1
src/modules/graphics/opengl/VertexBuffer.cpp

@@ -194,8 +194,10 @@ namespace opengl
 		// Copy the old buffer only if 'restore' was requested.
 		// Copy the old buffer only if 'restore' was requested.
 		const GLvoid *src = restore ? buffer_copy : 0;
 		const GLvoid *src = restore ? buffer_copy : 0;
 
 
+		while (GL_NO_ERROR != glGetError())
+			/* clear error messages */;
+
 		// Note that if 'src' is '0', no data will be copied.
 		// Note that if 'src' is '0', no data will be copied.
-		glGetError();
 		glBufferDataARB(getTarget(), getSize(), src, getUsage());
 		glBufferDataARB(getTarget(), getSize(), src, getUsage());
 		GLenum err = glGetError();
 		GLenum err = glGetError();