Also check if vertex array is supported on restoring GL state, not just saving it.

This removes OpenGL errors reported repeatedly, and closes ticket:3834.
master
Per Inge Mathisen 2012-12-19 23:01:22 +01:00
parent 2a8d1f7f71
commit ddec52a36e
1 changed files with 6 additions and 4 deletions

View File

@ -607,9 +607,11 @@ void __glcRestoreGLState(const __GLCglState* inGLState,
&& GLEW_ARB_vertex_buffer_object)) {
if (!inGLState->vertexArray)
glDisableClientState(GL_VERTEX_ARRAY);
glVertexPointer(inGLState->vertexArraySize, inGLState->vertexArrayType,
inGLState->vertexArrayStride,
inGLState->vertexArrayPointer);
if (inGLState->vertexArray == GL_TRUE) {
glVertexPointer(inGLState->vertexArraySize, inGLState->vertexArrayType,
inGLState->vertexArrayStride,
inGLState->vertexArrayPointer);
}
if (!inGLState->normalArray)
glDisableClientState(GL_NORMAL_ARRAY);
if (!inGLState->colorArray)
@ -618,7 +620,7 @@ void __glcRestoreGLState(const __GLCglState* inGLState,
glDisableClientState(GL_INDEX_ARRAY);
if (!inGLState->texCoordArray)
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
if (inAll || inContext->renderState.renderStyle == GLC_TEXTURE)
if ((inAll || inContext->renderState.renderStyle == GLC_TEXTURE) && inGLState->texCoordArray == GL_TRUE)
glTexCoordPointer(inGLState->texCoordArraySize,
inGLState->texCoordArrayType,
inGLState->texCoordArrayStride,