| Summary: | Android SDL2 documentation / code mismatch: Getting wrong OpenGL ES context version | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Michael Labbé <mike> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | minor | ||
| Priority: | P2 | CC: | gabomdq |
| Version: | 2.0.1 | ||
| Hardware: | All | ||
| OS: | Android (All) | ||
Fixed the wiki, thanks! |
On Android, SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 2 ); SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 0 ); must be called before initializing the GL context if you are programming the ES2 spec. The documentation currently states: SDL_GL_CONTEXT_MAJOR_VERSION and SDL_GL_CONTEXT_MINOR_VERSION are used when creating an OpenGL 3.x context. ... but says nothing about OpenGL ES. Proof: glGetString( GL_VERSION ) returns "OpenGL ES-CM 1.1" and "OpenGL ES 2.0 14.01002", respectively, when the correct attributes are set on my tegra3 (ES2 compatible) hardware. In the source code: SDL_egl.c: SDL_EGL_CreateContext(): if (_this->gl_config.major_version) { context_attrib_list[1] = _this->gl_config.major_version; }