STARK: Reset array buffer in OpenGL renderer

This commit is contained in:
Paweł Kołodziejski 2021-10-19 20:42:20 +02:00
parent c9cf81874a
commit 6b14053452
No known key found for this signature in database
GPG Key ID: 0BDADC9E74440FF7

View File

@ -222,6 +222,11 @@ FadeRenderer *OpenGLDriver::createFadeRenderer() {
}
void OpenGLDriver::start2DMode() {
#if defined(USE_OPENGL_SHADERS)
// The ShaderSurfaceRenderer sets an array buffer which conflict with fixed pipeline rendering
glBindBuffer(GL_ARRAY_BUFFER, 0);
#endif // defined(USE_OPENGL_SHADERS)
// Enable alpha blending
glEnable(GL_BLEND);
//glBlendEquation(GL_FUNC_ADD); // It's the default
@ -246,6 +251,11 @@ void OpenGLDriver::end2DMode() {
}
void OpenGLDriver::set3DMode() {
#if defined(USE_OPENGL_SHADERS)
// The ShaderSurfaceRenderer sets an array buffer which conflict with fixed pipeline rendering
glBindBuffer(GL_ARRAY_BUFFER, 0);
#endif // defined(USE_OPENGL_SHADERS)
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);