Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add XInitThreads to X11_CreateDevice.

The nVidia driver requires XInitThreads to be called for it to work in multithreaded mode. Sam also
says that the overhead for this is small enough that it should just be done by default at this point.
If this causes issues, we can add a hint later to enable / disable this call.
  • Loading branch information
Michael Sartain committed Oct 11, 2012
1 parent 8919996 commit fe51dbeb268c3674b8c6664e6d57f4e9880ac2f2
Showing with 5 additions and 0 deletions.
  1. +1 −0 src/video/x11/SDL_x11sym.h
  2. +4 −0 src/video/x11/SDL_x11video.c
@@ -81,6 +81,7 @@ SDL_X11_SYM(int,XMissingExtension,(Display* a,_Xconst char* b),(a,b),return)
SDL_X11_SYM(int,XMoveWindow,(Display* a,Window b,int c,int d),(a,b,c,d),return)
SDL_X11_SYM(int,XNextEvent,(Display* a,XEvent* b),(a,b),return)
SDL_X11_SYM(Display*,XOpenDisplay,(_Xconst char* a),(a),return)
SDL_X11_SYM(Status,XInitThreads,(void),(),return)
SDL_X11_SYM(int,XPeekEvent,(Display* a,XEvent* b),(a,b),return)
SDL_X11_SYM(int,XPending,(Display* a),(a),return)
SDL_X11_SYM(int,XPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j),(a,b,c,d,e,f,g,h,i,j),return)
@@ -156,6 +156,10 @@ X11_CreateDevice(int devindex)
return NULL;
}

// Need for threading gl calls. This is also required for the proprietary nVidia
// driver to be threaded.
XInitThreads();

/* Initialize all variables that we clean on shutdown */
device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
if (!device) {

0 comments on commit fe51dbe

Please sign in to comment.