src/video/x11/SDL_x11opengl.c
changeset 7412 50211a1fd557
parent 7191 75360622e65f
child 7413 30d42f6f2e8d
equal deleted inserted replaced
7410:a9878830f05e 7412:50211a1fd557
   530     XVisualInfo v, *vinfo;
   530     XVisualInfo v, *vinfo;
   531     int n;
   531     int n;
   532     GLXContext context = NULL, share_context;
   532     GLXContext context = NULL, share_context;
   533 
   533 
   534     if (_this->gl_config.share_with_current_context) {
   534     if (_this->gl_config.share_with_current_context) {
   535         share_context = (GLXContext)(_this->current_glctx);
   535         share_context = SDL_GL_GetCurrentContext();
   536     } else {
   536     } else {
   537         share_context = NULL;
   537         share_context = NULL;
   538     }
   538     }
   539 
   539 
   540     /* We do this to create a clean separation between X and GLX errors. */
   540     /* We do this to create a clean separation between X and GLX errors. */
   681     if ((interval < 0) && (!_this->gl_data->HAS_GLX_EXT_swap_control_tear)) {
   681     if ((interval < 0) && (!_this->gl_data->HAS_GLX_EXT_swap_control_tear)) {
   682         SDL_SetError("Negative swap interval unsupported in this GL");
   682         SDL_SetError("Negative swap interval unsupported in this GL");
   683     } else if (_this->gl_data->glXSwapIntervalEXT) {
   683     } else if (_this->gl_data->glXSwapIntervalEXT) {
   684         Display *display = ((SDL_VideoData *) _this->driverdata)->display;
   684         Display *display = ((SDL_VideoData *) _this->driverdata)->display;
   685         const SDL_WindowData *windowdata = (SDL_WindowData *)
   685         const SDL_WindowData *windowdata = (SDL_WindowData *)
   686             _this->current_glwin->driverdata;
   686             SDL_GL_GetCurrentWindow()->driverdata;
   687 
   687 
   688         Window drawable = windowdata->xwindow;
   688         Window drawable = windowdata->xwindow;
   689 
   689 
   690         /*
   690         /*
   691          * This is a workaround for a bug in NVIDIA drivers. Bug has been reported
   691          * This is a workaround for a bug in NVIDIA drivers. Bug has been reported
   725 X11_GL_GetSwapInterval(_THIS)
   725 X11_GL_GetSwapInterval(_THIS)
   726 {
   726 {
   727     if (_this->gl_data->glXSwapIntervalEXT) {
   727     if (_this->gl_data->glXSwapIntervalEXT) {
   728         Display *display = ((SDL_VideoData *) _this->driverdata)->display;
   728         Display *display = ((SDL_VideoData *) _this->driverdata)->display;
   729         const SDL_WindowData *windowdata = (SDL_WindowData *)
   729         const SDL_WindowData *windowdata = (SDL_WindowData *)
   730             _this->current_glwin->driverdata;
   730             SDL_GL_GetCurrentWindow()->driverdata;
   731         Window drawable = windowdata->xwindow;
   731         Window drawable = windowdata->xwindow;
   732         unsigned int allow_late_swap_tearing = 0;
   732         unsigned int allow_late_swap_tearing = 0;
   733         unsigned int interval = 0;
   733         unsigned int interval = 0;
   734 
   734 
   735         if (_this->gl_data->HAS_GLX_EXT_swap_control_tear) {
   735         if (_this->gl_data->HAS_GLX_EXT_swap_control_tear) {