Mercurial > sdl-ios-xcode
diff src/video/x11/SDL_x11gl.c @ 1168:045f186426e1
Dynamically load X11 libraries like we currently do for alsa, esd, etc.
This allows you to run an SDL program on a system without Xlib, since it'll
just report the x11 target unavailable at runtime.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sat, 05 Nov 2005 19:53:37 +0000 |
parents | 86885b40a53b |
children | e8e8dcb68e7a |
line wrap: on
line diff
--- a/src/video/x11/SDL_x11gl.c Sat Nov 05 17:41:11 2005 +0000 +++ b/src/video/x11/SDL_x11gl.c Sat Nov 05 19:53:37 2005 +0000 @@ -69,10 +69,10 @@ XVisualInfo vi_in; int out_count; - XGetWindowAttributes(SDL_Display, SDL_Window, &a); + pXGetWindowAttributes(SDL_Display, SDL_Window, &a); vi_in.screen = SDL_Screen; - vi_in.visualid = XVisualIDFromVisual(a.visual); - glx_visualinfo = XGetVisualInfo(SDL_Display, + vi_in.visualid = pXVisualIDFromVisual(a.visual); + glx_visualinfo = pXGetVisualInfo(SDL_Display, VisualScreenMask|VisualIDMask, &vi_in, &out_count); return glx_visualinfo; } @@ -188,7 +188,7 @@ attributes.colormap = SDL_XColorMap; mask = CWBackPixel | CWBorderPixel | CWColormap; - SDL_Window = XCreateWindow(SDL_Display, WMwindow, + SDL_Window = pXCreateWindow(SDL_Display, WMwindow, 0, 0, w, h, 0, glx_visualinfo->depth, InputOutput, glx_visualinfo->visual, mask, &attributes); @@ -209,10 +209,10 @@ int retval; #ifdef HAVE_OPENGL /* We do this to create a clean separation between X and GLX errors. */ - XSync( SDL_Display, False ); + pXSync( SDL_Display, False ); glx_context = this->gl_data->glXCreateContext(GFX_Display, glx_visualinfo, NULL, True); - XSync( GFX_Display, False ); + pXSync( GFX_Display, False ); if (glx_context == NULL) { SDL_SetError("Could not create GL context"); @@ -296,7 +296,7 @@ SDL_SetError("Unable to make GL context current"); retval = -1; } - XSync( GFX_Display, False ); + pXSync( GFX_Display, False ); /* * The context is now current, check for glXReleaseBuffersMESA()