[SDL] how to know if (direct render) hardware accelerated is available
Bob Pendleton
bob at pendleton.com
Fri Nov 16 10:35:51 PST 2007
On Fri, 2007-11-16 at 09:44 -0300, David Roguin wrote:
> With 'direct render' I was meaning "hardware accelerated".
> Is there any way to be sure that hardware accelerated is available?
>
> I was thinking that maybe with GL_VENDOR and GL_RENDER I could
> determine that, but I'm not really sure if that is the best way to do
> it.
That will work, but it requires that you have a list of valid vendor
names which can be a real pain to generate. The simple way is to run a
simple test and measure the performance. Just put a spinning logo at
load time for maybe 10 seconds. If you don't get a high enough frame
rate you know that you do not have accelerated graphics. If you do get a
good frame rate you know a little more. You can even just measure the
frame rate of the main application and if it is too slow, you can
politely quit.
Bob Pendleton
>
> The SDL_SysWMinfo has de Display, but I'm missing the GLXContext.
>
> David.
>
>
> On Nov 16, 2007 3:49 AM, Solra Bizna <sbizna at tejat.net> wrote:
> >
> > On Nov 15, 2007 6:55 PM, David Roguin <nesdavid at gmail.com> wrote:
> > > I want to know for a program running in linux if direct rendering is abailable.
> > > I believe glXIsDirect does the trick.
> > > The question is, can I call this function within a SDL context?
> > SDL under X11 uses GLX internally for OpenGL, so I would assume so. I
> > can think of two caveats, though.
> > 1) You'll need a Display and a GLXContext to pass to the function, and
> > I'm not sure how you'd get your hands on those.
> > 2) If you're taking "direct rendering" to mean "hardware accelerated,"
> > remember that indirect rendering can be accelerated too. For example,
> > if X11 forwarding is in effect, rendering may be hardware accelerated
> > (and reasonably fast) but glXIsDirect will return False. (I'm not sure
> > how AIGLX fits in.)
> > -:sigma.SB
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
--
+--------------------------------------+
+ Bob Pendleton: writer and programmer +
+ email: Bob at Pendleton.com +
+ web: www.GameProgrammer.com +
+ www.Wise2Food.com +
+ nutrient info on 7,000+ common foods +
+--------------------------------------+
More information about the SDL
mailing list