I’m using OpenGL for some 2D acceleration,
and want to be able to specify a requirement
for hardware acceleration - since software
rendering is not a good alternative, and I
rather do my own regular code in that case…
(using the regular possibly colorkeyed blits)
I noticed that a flag for this was missing from
SDL version 1.2.6 / CVS, as far as I could tell ?
I suggest adding a new SDL_GLattr option of:
SDL_GL_ACCELERATION
Or perhaps the longer: SDL_GL_ACCELERATION_REQUIRED ?
It would work similar to SDL_GL_DOUBLEBUFFER,
and default to “0”. A set value of “1” would mean
that hardware is required, otherwise a software
fallback renderer is acceptable too (=old behaviour)
That is, I want it to fail to set up a video mode
if a suitable hardware accelerator cannot be found!
It’s trivial to add this for Macintosh and Windows,
using AGL_ACCELERATED/PFD_GENERIC_ACCELERATED flags.
(It probably has been discussed before, I’m new to SDL)
Best “solution” for Linux so far is checking
whether glGetString(GL_RENDERER) returns a
value equal to “Mesa GLX Indirect” (=software?)
Not sure if this is 100% correct, but seems to be?
Only pain being that this GL call needs an active
OpenGL context, in order to not just return NULL…
Anyone have any better ideas for X11? (or others)
–anders
PS. A full patch is available too, seems to be working…
http://www.algonet.se/~afb/SDL-1.2.6-glaccelerated.patch