[Scummvm-git-logs] scummvm master -> 3a2415dab491302c618cfe30c20767c8e41896ff

lephilousophe noreply at scummvm.org
Sun Jun 14 07:37:53 UTC 2026


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
3c823e8be3 GRAPHICS: OPENGL: Forbid creation of incompatible contexts
3a2415dab4 GRAPHICS: OPENGL: Fix GLES build without GLAD


Commit: 3c823e8be30615d9a462033927567d66d7e2e466
    https://github.com/scummvm/scummvm/commit/3c823e8be30615d9a462033927567d66d7e2e466
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-06-14T09:36:51+02:00

Commit Message:
GRAPHICS: OPENGL: Forbid creation of incompatible contexts

When building with a forced OpenGL mode, other modes must fail.
This allows to call specific GL functions in the context detection code
while not using GLAD.

Changed paths:
    graphics/opengl/context.cpp


diff --git a/graphics/opengl/context.cpp b/graphics/opengl/context.cpp
index a04c9546d8f..996b7c681fc 100644
--- a/graphics/opengl/context.cpp
+++ b/graphics/opengl/context.cpp
@@ -168,8 +168,10 @@ void Context::initialize(ContextType contextType) {
 		extString = "";
 	}
 
+#if !USE_FORCED_GLES && !USE_FORCED_GLES2
 	bool EXTFramebufferMultisample = false;
 	bool EXTFramebufferBlit = false;
+#endif
 
 	Common::StringTokenizer tokenizer(extString, " ");
 	while (!tokenizer.empty()) {
@@ -191,10 +193,12 @@ void Context::initialize(ContextType contextType) {
 			packedDepthStencilSupported = true;
 		} else if (token == "GL_EXT_unpack_subimage") {
 			unpackSubImageSupported = true;
+#if !USE_FORCED_GLES && !USE_FORCED_GLES2
 		} else if (token == "GL_EXT_framebuffer_multisample") {
 			EXTFramebufferMultisample = true;
 		} else if (token == "GL_EXT_framebuffer_blit") {
 			EXTFramebufferBlit = true;
+#endif
 		} else if (token == "GL_OES_depth24") {
 			OESDepth24 = true;
 		} else if (token == "GL_SGIS_texture_edge_clamp") {
@@ -210,6 +214,9 @@ void Context::initialize(ContextType contextType) {
 	}
 
 	if (type == kContextGLES2) {
+#if USE_FORCED_GL || USE_FORCED_GLES
+		error("Creating GLES2 context with non-GLES2 build");
+#else
 // OGLES2 on AmigaOS reports GLSL version as 0.9 but we do what is needed to make it work
 // so let's pretend it supports 1.00
 #if defined(__amigaos4__)
@@ -258,7 +265,11 @@ void Context::initialize(ContextType contextType) {
 		textureLookupPrecision = precision;
 
 		debug(5, "OpenGL: GLES2 context initialized");
+#endif
 	} else if (type == kContextGLES) {
+#if USE_FORCED_GL || USE_FORCED_GLES2
+		error("Creating GLES context with non-GLES build");
+#else
 		// GLES doesn't support shaders natively
 
 		// ScummVM does not support multisample FBOs with GLES for now
@@ -274,7 +285,11 @@ void Context::initialize(ContextType contextType) {
 		// Precision is irrelevant (shaders) in GLES
 
 		debug(5, "OpenGL: GLES context initialized");
+#endif
 	} else if (type == kContextGL) {
+#if USE_FORCED_GLES || USE_FORCED_GLES2
+		error("Creating GL context with non-GL build");
+#else
 		// Official support of shaders starts with version 110
 		// Older versions didn't support the #version directive and were only available through
 		// ARB extensions which we removed support for
@@ -309,6 +324,7 @@ void Context::initialize(ContextType contextType) {
 		textureLookupPrecision = UINT_MAX;
 
 		debug(5, "OpenGL: GL context initialized");
+#endif
 	} else {
 		warning("OpenGL: Unknown context initialized");
 	}


Commit: 3a2415dab491302c618cfe30c20767c8e41896ff
    https://github.com/scummvm/scummvm/commit/3a2415dab491302c618cfe30c20767c8e41896ff
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-06-14T09:36:57+02:00

Commit Message:
GRAPHICS: OPENGL: Fix GLES build without GLAD

Don't use functions or defines not available

Changed paths:
    backends/graphics/opengl/framebuffer.cpp
    graphics/opengl/context.cpp


diff --git a/backends/graphics/opengl/framebuffer.cpp b/backends/graphics/opengl/framebuffer.cpp
index c3b373da163..a762b157746 100644
--- a/backends/graphics/opengl/framebuffer.cpp
+++ b/backends/graphics/opengl/framebuffer.cpp
@@ -113,6 +113,7 @@ void Framebuffer::applyBlendState() {
 			GL_CALL(glDisable(GL_BLEND));
 			break;
 		case kBlendModeOpaque:
+#if !USE_FORCED_GLES
 			if (!glBlendColor) {
 				// If glBlendColor is not available (old OpenGL) fallback on disabling blending
 				GL_CALL(glDisable(GL_BLEND));
@@ -121,6 +122,10 @@ void Framebuffer::applyBlendState() {
 			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));
+#else
+			// GLES has no glBlendColor
+			GL_CALL(glDisable(GL_BLEND));
+#endif
 			break;
 		case kBlendModeTraditionalTransparency:
 			GL_CALL(glEnable(GL_BLEND));
diff --git a/graphics/opengl/context.cpp b/graphics/opengl/context.cpp
index 996b7c681fc..b4e218ede29 100644
--- a/graphics/opengl/context.cpp
+++ b/graphics/opengl/context.cpp
@@ -333,7 +333,12 @@ void Context::initialize(ContextType contextType) {
 		glGetIntegerv(GL_MAX_SAMPLES, (GLint *)&multisampleMaxSamples);
 	}
 
-	const char *glslVersionString = glslVersion ? (const char *)glGetString(GL_SHADING_LANGUAGE_VERSION) : "";
+	const char *glslVersionString =
+#if !USE_FORCED_GLES
+		glslVersion ? (const char *)glGetString(GL_SHADING_LANGUAGE_VERSION) : "";
+#else
+		"";
+#endif
 
 	// Log features supported by GL context.
 	debug(5, "OpenGL version: %s", glGetString(GL_VERSION));




More information about the Scummvm-git-logs mailing list