comparison src/video/x11/SDL_x11opengl.c @ 2178:114a541cfae2

Creating a context makes it current, per the documentation. Applied a variant of the multi-card OpenGL fix from SDL 1.2
author Sam Lantinga <slouken@libsdl.org>
date Thu, 12 Jul 2007 06:31:36 +0000
parents 12bcd4fd2606
children 5523312f311e
comparison
equal deleted inserted replaced
2177:4f896c20caf6 2178:114a541cfae2
424 } 424 }
425 XSync(display, False); 425 XSync(display, False);
426 426
427 if (!context) { 427 if (!context) {
428 SDL_SetError("Could not create GL context"); 428 SDL_SetError("Could not create GL context");
429 } 429 return NULL;
430 return (SDL_GLContext) context; 430 }
431
432 if (X11_GL_MakeCurrent(_this, window, context) < 0) {
433 X11_GL_DeleteContext(_this, context);
434 return NULL;
435 }
436
437 return context;
431 } 438 }
432 439
433 int 440 int
434 X11_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) 441 X11_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
435 { 442 {