From e225f54386ab044df59cb3f79a556d434b8733ac Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Sat, 2 Oct 2021 20:01:44 +0100 Subject: [PATCH] Fix bug when glVertexPointer etc. is called without client state enabled --- GL/draw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GL/draw.c b/GL/draw.c index 3afc053..edebc33 100644 --- a/GL/draw.c +++ b/GL/draw.c @@ -1293,6 +1293,11 @@ void APIENTRY glEnableClientState(GLenum cap) { default: _glKosThrowError(GL_INVALID_ENUM, __func__); } + + /* It's possible that we called glVertexPointer and friends before + * calling glEnableClientState, so we should recheck to make sure + * everything is in the right format with this new information */ + _glRecalcFastPath(); } void APIENTRY glDisableClientState(GLenum cap) { @@ -1316,6 +1321,9 @@ void APIENTRY glDisableClientState(GLenum cap) { default: _glKosThrowError(GL_INVALID_ENUM, __func__); } + + /* State changed, recalculate */ + _glRecalcFastPath(); } GLuint _glGetActiveClientTexture() {