Skip to content

Commit 1ce7ff5

Browse files
authored
[contrib.glfw3] Fixes GLFW_CONTEXT_VERSION_MAJOR ignored (#23401)
This is a follow up to the [ticket](#23372) discussion. When users are using my port, the window hint `GLFW_CONTEXT_VERSION_MAJOR` is ignored due to how Emscripten behaves internally. If the port sets the linker flag `MAX_WEBGL_VERSION=2`, then for a user of the library, which interact throught the GLFW API, it transparently works without asking the user to understand the internals of Emscripten and modify their build script.
1 parent e49e05f commit 1ce7ff5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/ports/contrib/glfw3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def linker_setup(ports, settings):
8888
root_path = os.path.join(ports.get_dir(), port_name)
8989
source_js_path = os.path.join(root_path, 'src', 'js', 'lib_emscripten_glfw3.js')
9090
settings.JS_LIBRARIES += [source_js_path]
91+
settings.MAX_WEBGL_VERSION = 2 # for GLFW_CONTEXT_VERSION_MAJOR to work
9192

9293

9394
# Using contrib.glfw3 to avoid installing headers into top level include path

0 commit comments

Comments
 (0)