mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Workaround GLEW error code when calling glewInit() on Wayland
* Fixes OpenGL on Wayland when the GLX flavor of GLEW is linked * Only if SDL2's video driver is "wayland" we also allow the GLEW_ERROR_NO_GLX_DISPLAY error code to be accepted as if glewInit() actually succeeded * Hopefully this won't be needed anymore on future versions of GLEW when glewContextInit() is made part of the public API
This commit is contained in:
parent
41cd82c2d3
commit
fe35322bb0
|
@ -443,7 +443,9 @@ static bool BackendInitGlew(EBackendType BackendType, int &GlewMajor, int &GlewM
|
||||||
#ifdef CONF_GLEW_HAS_CONTEXT_INIT
|
#ifdef CONF_GLEW_HAS_CONTEXT_INIT
|
||||||
if(GLEW_OK != glewContextInit())
|
if(GLEW_OK != glewContextInit())
|
||||||
#else
|
#else
|
||||||
if(GLEW_OK != glewInit())
|
GLenum InitResult = glewInit();
|
||||||
|
const char *pVideoDriver = SDL_GetCurrentVideoDriver();
|
||||||
|
if(GLEW_OK != InitResult && pVideoDriver && !str_comp(pVideoDriver, "wayland") && GLEW_ERROR_NO_GLX_DISPLAY != InitResult)
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue