emscripten-core / emscripten-core/emscripten

How to setup webgl 2.0 context with SDL2 in c++?

Open
#12,875 3 comments 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

As the code in https://github.com/charlietsao/opengl-canvas-wasm/blob/main/main.cpp, I changed
```
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
```

to

```
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
```

But still can see that `GL_VERSION = OpenGL ES 2.0 (WebGL 1.0 (OpenGL ES 2.0 Chromium))` in runtime. How to setup webgl 2.0?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.