| Summary: | SDL_GL_GetProcAddress can use wrong library on Android | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Richard Russell <rtrussell> |
| Component: | video | Assignee: | Sylvain <sylvain.becker> |
| Status: | WAITING --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.7 | ||
| Hardware: | All | ||
| OS: | Android (All) | ||
Sylvain believes he has fixed this here: https://hg.libsdl.org/SDL/rev/00a1aa5a1fc0 Can you double check? Also, Sylvain, I believe we can re-enable the code to call eglGetProcAddress(), if that's the right solution here. From bug 4040, bug 4041 : https://hg.libsdl.org/SDL/rev/00a1aa5a1fc0 It should now unload/re-load the correct EGL libs so that SDL_GL_GetProcAddress can get them. but eglGetProcAddress is still busted and remains un-activated on android https://hg.libsdl.org/SDL/file/00fb5966c44f/src/video/SDL_egl.c#l216 (see test case on bug 4040) |
If SDL creates an OpenGLES 1 context, for example as a result of this hint: SDL_SetHint (SDL_HINT_RENDER_DRIVER, "opengles") ; subsequent calls to SDL_GL_GetProcAddress (on Android) search the libGLESv2.so library rather than the correct libGLESv1.so library. This results in NULL being returned for functions which don't exist in OpenGLES 2 (such as glLogicOp) and probably an incorrect address being returned for other functions. The simplest solution is for SDL to call 'eglGetProcAddress' which is guaranteed to use the correct library. Currently the code to do this (in SDL_egl.c) is disabled, apparently because of a bug in Android. However that bug was supposedly fixed in 2010 so it may be that the conditional test can be removed, or at least be made dependent on the version of Android. If the current 'fallback' code is retained, it will need to be changed to test what rendering context has been created (which may not always be what the user requested) and select the appropriate library accordingly.