Fix #31593: Every time I switch between edit and object mode, it crashes

Crash was caused by incorrect restoring OpenGL context due to some
weird bit operations used to indicate whether stuff like color arrays
is initialized resulting in some unpredictable results on different
platforms and drivers.
This commit is contained in:
2012-06-05 08:41:53 +00:00
parent 67ba133b19
commit 0adf252c9b

View File

@@ -1151,7 +1151,7 @@ void GPU_buffer_unbind(void)
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
}
}
GLStates &= !(GPU_BUFFER_VERTEX_STATE | GPU_BUFFER_NORMAL_STATE |
GLStates &= ~(GPU_BUFFER_VERTEX_STATE | GPU_BUFFER_NORMAL_STATE |
GPU_BUFFER_TEXCOORD_STATE | GPU_BUFFER_COLOR_STATE |
GPU_BUFFER_ELEMENT_STATE);
@@ -1191,7 +1191,7 @@ void GPU_color_switch(int mode)
else {
if (GLStates & GPU_BUFFER_COLOR_STATE)
glDisableClientState(GL_COLOR_ARRAY);
GLStates &= (!GPU_BUFFER_COLOR_STATE);
GLStates &= ~GPU_BUFFER_COLOR_STATE;
}
}