Update glad loader

- Add requested version parameter
- Use custom loading for GL 2.0 FO extensions
- Use GLES loader when we request GLES
This commit is contained in:
Adrian Graber
2021-02-17 02:27:06 +01:00
parent 767ee0eac3
commit d341d73f80
3 changed files with 64 additions and 12 deletions
+2 -2
View File
@@ -1571,7 +1571,7 @@ startSDL2(void)
}
ctx = SDL_GL_CreateContext(win);
if (!gladLoadGLLoader((GLADloadproc) SDL_GL_GetProcAddress)){
if (!((gl3Caps.gles ? gladLoadGLES2Loader : gladLoadGLLoader) ((GLADloadproc) SDL_GL_GetProcAddress, gl3Caps.glversion)) ) {
RWERROR((ERR_GENERAL, "gladLoadGLLoader failed"));
SDL_GL_DeleteContext(ctx);
SDL_DestroyWindow(win);
@@ -1734,7 +1734,7 @@ startGLFW(void)
glfwMakeContextCurrent(win);
/* Init GLAD */
if(!gladLoadGLLoader((GLADloadproc) glfwGetProcAddress)) {
if (!((gl3Caps.gles ? gladLoadGLES2Loader : gladLoadGLLoader) ((GLADloadproc) glfwGetProcAddress, gl3Caps.glversion)) ) {
RWERROR((ERR_GENERAL, "gladLoadGLLoader failed"));
glfwDestroyWindow(win);
return 0;