comparison src/video/x11/SDL_x11opengles.c @ 3218:81773a1eac83

Patch from David Carre: I fixed a bug in the "SDL_DestroyRenderer()" function in the pandora x11 renderer (in fact the bug was in the "X11_GLES_MakeCurrent()" function) that was causing a crash when exiting SDL. There was a problem while terminating the x11 egl window, that was preventing to quit/close SDL/SDL-window then reload SDL/SDL-window inside the same application.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 30 Jul 2009 14:53:57 +0000
parents c68d2ca5970f
children d559edc85610
comparison
equal deleted inserted replaced
3217:26ce0b98f2fb 3218:81773a1eac83
296 int 296 int
297 X11_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) 297 X11_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
298 { 298 {
299 int retval; 299 int retval;
300 300
301 SDL_WindowData *data = (SDL_WindowData *) window->driverdata; 301 // SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
302 Display *display = data->videodata->display; 302 // Display *display = data->videodata->display;
303 303
304 retval = 1; 304 retval = 1;
305 if (!_this->gles_data->eglMakeCurrent(_this->gles_data->egl_display, 305 if (!_this->gles_data->eglMakeCurrent(_this->gles_data->egl_display,
306 _this->gles_data->egl_surface, 306 _this->gles_data->egl_surface,
307 _this->gles_data->egl_surface, 307 _this->gles_data->egl_surface,
308 _this->gles_data->egl_context)) { 308 _this->gles_data->egl_context)) {
309 SDL_SetError("Unable to make EGL context current"); 309 SDL_SetError("Unable to make EGL context current");
310 retval = -1; 310 retval = -1;
311 } 311 }
312 XSync(display, False); 312 // XSync(display, False);
313 313
314 return (retval); 314 return (retval);
315 } 315 }
316 316
317 static int swapinterval = -1; 317 static int swapinterval = -1;
357 egl_surface); 357 egl_surface);
358 _this->gles_data->egl_surface = EGL_NO_SURFACE; 358 _this->gles_data->egl_surface = EGL_NO_SURFACE;
359 } 359 }
360 } 360 }
361 _this->gles_data->egl_active = 0; 361 _this->gles_data->egl_active = 0;
362
363 /* crappy fix */
364 X11_GLES_UnloadLibrary(_this);
365
362 } 366 }
363 367
364 #endif /* SDL_VIDEO_OPENGL_ES */ 368 #endif /* SDL_VIDEO_OPENGL_ES */
365 369
366 /* vi: set ts=4 sw=4 expandtab: */ 370 /* vi: set ts=4 sw=4 expandtab: */