|
@@ -210,36 +210,31 @@ X11_GL_LoadLibrary(_THIS, const char *path) |
|
|
/* Initialize extensions */ |
|
|
X11_GL_InitExtensions(_this); |
|
|
|
|
|
/* If SDL_GL_CONTEXT_EGL has been changed to 1, and there's |
|
|
* no GLX_EXT_create_context_es2_profile extension switch over to X11_GLES functions */ |
|
|
if (_this->gl_config.use_egl == 1) { |
|
|
if (_this->gl_data->HAS_GLX_EXT_create_context_es2_profile) { |
|
|
/* We cheat a little bit here by using GLX instead of EGL |
|
|
* to improve our chances of getting hardware acceleration */ |
|
|
_this->gl_config.use_egl = 0; |
|
|
_this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; |
|
|
} else { |
|
|
/* If we need a GL ES context and there's no |
|
|
* GLX_EXT_create_context_es2_profile extension, switch over to X11_GLES functions |
|
|
*/ |
|
|
if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES && |
|
|
! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile ) { |
|
|
#if SDL_VIDEO_OPENGL_EGL |
|
|
X11_GL_UnloadLibrary(_this); |
|
|
/* Better avoid conflicts! */ |
|
|
if (_this->gl_config.dll_handle != NULL ) { |
|
|
GL_UnloadObject(_this->gl_config.dll_handle); |
|
|
_this->gl_config.dll_handle = NULL; |
|
|
} |
|
|
_this->GL_LoadLibrary = X11_GLES_LoadLibrary; |
|
|
_this->GL_GetProcAddress = X11_GLES_GetProcAddress; |
|
|
_this->GL_UnloadLibrary = X11_GLES_UnloadLibrary; |
|
|
_this->GL_CreateContext = X11_GLES_CreateContext; |
|
|
_this->GL_MakeCurrent = X11_GLES_MakeCurrent; |
|
|
_this->GL_SetSwapInterval = X11_GLES_SetSwapInterval; |
|
|
_this->GL_GetSwapInterval = X11_GLES_GetSwapInterval; |
|
|
_this->GL_SwapWindow = X11_GLES_SwapWindow; |
|
|
_this->GL_DeleteContext = X11_GLES_DeleteContext; |
|
|
return X11_GLES_LoadLibrary(_this, NULL); |
|
|
X11_GL_UnloadLibrary(_this); |
|
|
/* Better avoid conflicts! */ |
|
|
if (_this->gl_config.dll_handle != NULL ) { |
|
|
GL_UnloadObject(_this->gl_config.dll_handle); |
|
|
_this->gl_config.dll_handle = NULL; |
|
|
} |
|
|
_this->GL_LoadLibrary = X11_GLES_LoadLibrary; |
|
|
_this->GL_GetProcAddress = X11_GLES_GetProcAddress; |
|
|
_this->GL_UnloadLibrary = X11_GLES_UnloadLibrary; |
|
|
_this->GL_CreateContext = X11_GLES_CreateContext; |
|
|
_this->GL_MakeCurrent = X11_GLES_MakeCurrent; |
|
|
_this->GL_SetSwapInterval = X11_GLES_SetSwapInterval; |
|
|
_this->GL_GetSwapInterval = X11_GLES_GetSwapInterval; |
|
|
_this->GL_SwapWindow = X11_GLES_SwapWindow; |
|
|
_this->GL_DeleteContext = X11_GLES_DeleteContext; |
|
|
return X11_GLES_LoadLibrary(_this, NULL); |
|
|
#else |
|
|
return SDL_SetError("SDL not configured with EGL support"); |
|
|
return SDL_SetError("SDL not configured with EGL support"); |
|
|
#endif |
|
|
} |
|
|
} |
|
|
|
|
|
return 0; |
|
|