summaryrefslogtreecommitdiff
path: root/src/video/x11/SDL_x11opengl.c
diff options
context:
space:
mode:
authorRyan C. Gordon <icculus@icculus.org>2015-02-17 23:00:46 -0500
committerRyan C. Gordon <icculus@icculus.org>2015-02-17 23:00:46 -0500
commite79d26cc2f67540a00d66adf21b0f41b66e2377b (patch)
tree327310c9e9005b47988e50bea8b7011040aa926b /src/video/x11/SDL_x11opengl.c
parent20e1a72dbd1e628ab53a6660788577bc65bba7ea (diff)
X11: Don't create a window and GL context to look up the glX extension string.
It's not necessary.
Diffstat (limited to 'src/video/x11/SDL_x11opengl.c')
-rw-r--r--src/video/x11/SDL_x11opengl.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c
index 93dcd8c2ea..f89a9cc0ac 100644
--- a/src/video/x11/SDL_x11opengl.c
+++ b/src/video/x11/SDL_x11opengl.c
@@ -312,32 +312,10 @@ static void
X11_GL_InitExtensions(_THIS)
{
Display *display = ((SDL_VideoData *) _this->driverdata)->display;
- int screen = DefaultScreen(display);
- XVisualInfo *vinfo;
- XSetWindowAttributes xattr;
- Window w;
- GLXContext context;
+ const int screen = DefaultScreen(display);
const char *(*glXQueryExtensionsStringFunc) (Display *, int);
const char *extensions;
- vinfo = X11_GL_GetVisual(_this, display, screen);
- if (!vinfo) {
- return;
- }
- xattr.background_pixel = 0;
- xattr.border_pixel = 0;
- xattr.colormap =
- X11_XCreateColormap(display, RootWindow(display, screen), vinfo->visual,
- AllocNone);
- w = X11_XCreateWindow(display, RootWindow(display, screen), 0, 0, 32, 32, 0,
- vinfo->depth, InputOutput, vinfo->visual,
- (CWBackPixel | CWBorderPixel | CWColormap), &xattr);
- context = _this->gl_data->glXCreateContext(display, vinfo, NULL, True);
- if (context) {
- _this->gl_data->glXMakeCurrent(display, w, context);
- }
- X11_XFree(vinfo);
-
glXQueryExtensionsStringFunc =
(const char *(*)(Display *, int)) X11_GL_GetProcAddress(_this,
"glXQueryExtensionsString");
@@ -397,13 +375,6 @@ X11_GL_InitExtensions(_THIS)
if (HasExtension("GLX_EXT_create_context_es2_profile", extensions)) {
_this->gl_data->HAS_GLX_EXT_create_context_es2_profile = SDL_TRUE;
}
-
- if (context) {
- _this->gl_data->glXMakeCurrent(display, None, NULL);
- _this->gl_data->glXDestroyContext(display, context);
- }
- X11_XDestroyWindow(display, w);
- X11_PumpEvents(_this);
}
/* glXChooseVisual and glXChooseFBConfig have some small differences in