OPENGL: Don't use glBlendColor when it's not available

Bare Windows XP only has OpenGL 1.1 implementation where the function
is not here.
Fallback on no blending at all: this is like it was before.
This commit is contained in:
Le Philousophe 2024-06-30 15:36:17 +02:00
parent bdc364b238
commit 81196ec6c6

View File

@ -112,6 +112,11 @@ void Framebuffer::applyBlendState() {
GL_CALL(glDisable(GL_BLEND));
break;
case kBlendModeOpaque:
if (!glBlendColor) {
// If glBlendColor is not available (old OpenGL) fallback on disabling blending
GL_CALL(glDisable(GL_BLEND));
break;
}
GL_CALL(glEnable(GL_BLEND));
GL_CALL(glBlendColor(1.f, 1.f, 1.f, 0.f));
GL_CALL(glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR));