Fixed crash if the OpenGL library hasn't been loaded yet
parent
d12d7952f1
commit
e14e0ef947
|
@ -511,17 +511,16 @@ X11_GL_GetAttributes(_THIS, Display * display, int screen, int * attribs, int si
|
||||||
XVisualInfo *
|
XVisualInfo *
|
||||||
X11_GL_GetVisual(_THIS, Display * display, int screen)
|
X11_GL_GetVisual(_THIS, Display * display, int screen)
|
||||||
{
|
{
|
||||||
XVisualInfo *vinfo;
|
|
||||||
|
|
||||||
/* 64 seems nice. */
|
/* 64 seems nice. */
|
||||||
int attribs[64];
|
int attribs[64];
|
||||||
X11_GL_GetAttributes(_this,display,screen,attribs,64,SDL_FALSE);
|
XVisualInfo *vinfo;
|
||||||
|
|
||||||
if (!_this->gl_data) {
|
if (!_this->gl_data) {
|
||||||
/* The OpenGL library wasn't loaded, SDL_GetError() should have info */
|
/* The OpenGL library wasn't loaded, SDL_GetError() should have info */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
X11_GL_GetAttributes(_this, display, screen, attribs, 64, SDL_FALSE);
|
||||||
vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs);
|
vinfo = _this->gl_data->glXChooseVisual(display, screen, attribs);
|
||||||
if (!vinfo) {
|
if (!vinfo) {
|
||||||
SDL_SetError("Couldn't find matching GLX visual");
|
SDL_SetError("Couldn't find matching GLX visual");
|
||||||
|
|
|
@ -373,7 +373,7 @@ X11_CreateWindow(_THIS, SDL_Window * window)
|
||||||
#if SDL_VIDEO_OPENGL_GLX
|
#if SDL_VIDEO_OPENGL_GLX
|
||||||
&& ( !_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile )
|
&& ( !_this->gl_data || ! _this->gl_data->HAS_GLX_EXT_create_context_es2_profile )
|
||||||
#endif
|
#endif
|
||||||
){
|
) {
|
||||||
vinfo = X11_GLES_GetVisual(_this, display, screen);
|
vinfo = X11_GLES_GetVisual(_this, display, screen);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue