Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLFW_CONTEXT_VERSION_MAJOR is ignored #14

Open
ypujante opened this issue Jan 14, 2025 · 5 comments
Open

GLFW_CONTEXT_VERSION_MAJOR is ignored #14

ypujante opened this issue Jan 14, 2025 · 5 comments

Comments

@ypujante
Copy link
Member

Due to how the internals of Emscripten work, the window hint GLFW_CONTEXT_VERSION_MAJOR is ignored unless the linker flag -sMAX_WEBGL_VERSION=2 is set when compiling.

@ypujante
Copy link
Member Author

This will be fixed when Emscripten 4.0.1 is released (this bug will be closed then).

The current workaround is to add the linker flag -sMAX_WEBGL_VERSION=2 manually to your build

@valentijnnieman
Copy link

Wanted to add I seemed to have to add -sMIN_WEBGL_VERSION=2 as well to get WebGL 2 support.

@ypujante
Copy link
Member Author

@valentijnnieman If you add -sMIN_WEBGL_VERSION=2 then you get a WebGL 2 context no matter what GLFW_CONTEXT_VERSION_MAJOR. It is described in the issue I referenced.

@valentijnnieman
Copy link

@valentijnnieman If you add -sMIN_WEBGL_VERSION=2 then you get a WebGL 2 context no matter what GLFW_CONTEXT_VERSION_MAJOR. It is described in the issue I referenced.

Right. I guess I assumed someone setting their GLFW_CONTEXT_VERSION_MAJOR to 2 would expect it to be 2. I think I didn't get a WebGL2 context with -sMAX_WEBGL_VERSION=2 and GLFW_CONTEXT_VERSION_MAJOR set to 2. Oh well!

@ypujante
Copy link
Member Author

The internals of Emscripten around this topic are quite awfully designed as I pointed out in this response.

When Emscripten 4.0.1 is released, you will just have to use the contrib port and not have to deal with this nonsense... It is already merged, it just needs to be released...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants