[SDL] Accelerated OpenGL in SDL

Anders F Björklund afb at algonet.se
Sun Jan 4 14:55:02 PST 2004


Sam Lantinga wrote:
>> I'm using OpenGL for some 2D acceleration,
>> and want to be able to specify a requirement
>> for hardware acceleration
>
> Unfortunately there isn't any good way of telling what OpenGL driver 
> is in
> use, and what features it accelerates in hardware.  Long story short, 
> the
> best option is to provide some way of benchmarking the current 
> configuration
> with the features you use, and see if it's fast enough.  Make sure 
> that you
> provide a way for the user to re-configure once drivers have been 
> updated.

Just thought it could be added to the API, since it was rather simple
to do on the other SDL platforms ? (I'm working on a Macintosh myself)

If the card didn't accelerate every single function that is OK,
I just didn't want it to choose the default software renderer...
Because then it would be no point of using OpenGL for me, and
I could stick to the regular surfaces and blits instead. (2D)


But the biggest problem I had was that SDL 1.2.6 crashed on Linux/X11
when requesting a regular surface, after first requesting a GL one.

Haven't debugged it fully yet, but it looked something like this:
> Program received signal SIGSEGV, Segmentation fault.
>
> (gdb) bt
> #0  0x0fba03e4 in XShmPutImage () from /usr/X11R6/lib/libXext.so.6
> #1  0x0fba0360 in XShmPutImage () from /usr/X11R6/lib/libXext.so.6
> #2  0x0ff94cec in SDL_UpdateRects (screen=0x0, numrects=1, 
> rects=0x7ffff518) at SDL_video.c:1039
> #3  0x0ff94b7c in SDL_UpdateRect (screen=0x0, x=2139062143, 
> y=1208108072, w=1296651309, h=4278124287)
>     at SDL_video.c:980
> #4  0x0ff94ee4 in SDL_Flip (screen=0x0) at SDL_video.c:1093
> #5  0x0ff93d94 in SDL_ClearSurface (surface=0x10023050) at 
> SDL_video.c:500
> #6  0x0ff941e8 in SDL_SetVideoMode (width=640, height=480, bpp=16, 
> flags=1073741825) at SDL_video.c:690

Unless something weird happened, I think the params above are bogus ?
(Probably a side effect of running an optimized library version.)

--anders

PS. I have some patches for the Carbon version of the Mac driver,
     since I'm not really *that* fond of Objective-C and Quartz...
     Will send those later on, probably not until SDL 1.2.7 is out.





More information about the SDL mailing list