PDA

View Full Version : SDL w/ GL crashes X after exit



akashiraffee
11-18-2009, 07:26 AM
I've done some openGL 3D stuff using glut. I decided to switch to SDL.

But frequently -- particularly if I don't run in fullscreen -- anything SDL with GL in it causes a seg fault in libglx after it exits, which crashes X windows.

This includes demo programs from the SDL Guide. The problem seems to be less likely when the video mode is restricted to 640x480. SDL's video mode stuff is it's own thing, but I did not have any problems when using it without GL (and I didn't have any problems with GL and glut). Does anyone know anything about this -- eg, a way of optimally determining what the video mode should be AND the related "SDL_GL_Atttributes"?

Otherwise I have to find a way to do what I want without SDL. I guess that is okay, except I was hoping that I could port what I'm working on to windows easily, which it will not be easy at all without SDL, I think.

Thanks in advance!

ZbuffeR
11-18-2009, 09:49 AM
Try GLFW for crossplatform stuff.
Strange that SDL crashes that way, can you give more details ?
hardware ? OS version ? kernel, Xorg ? SDL version ? Do you use Compiz ?

akashiraffee
11-18-2009, 03:43 PM
Tweaking the video settings definitely makes a difference, but at best I am still crashing maybe 1 time in 10 (at worst, it is more likely than not), altho I can at least get it beyond 640x480 now. Which again, implies that there is a "best" choice but neither the SDL docs nor the SDL forum seem to have any ideas about how or why to make that choice.

My hardware may be the issue -- it's just an onboard via chrome chip which AFAICT has no GL driver under linux, so it's just software emulation or whatever. I believe that's the purpose of libglx.

The OS is fedora core 10-64, all the libraries are from the disto but the kernel is 2.6.29.2, built by me. I don't use compiz.

I don't think I will be sticking with SDL anyway. Maybe I'll try GLFW, or go back to glut, which was actually fine and IMO maybe better suited to this stuff than SDL. Is my choice of toolkit relevant "performance wise" at all, as far as OGL is concerned?

ZbuffeR
11-18-2009, 04:01 PM
"performance wise" no. It is more about different features.

Dark Photon
11-18-2009, 06:38 PM
I don't use compiz.
Also, you don't use KDE4, right? Or if you do, you've turned off compositing? (Start->Configure Desktop->Desktop->Enable Desktop Effects - UNCHECK, Apply).

Not to say that this will cause GL apps problems, but it sure takes a healthy bite out realtime GL perf.