The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
how to know if (direct render) hardware accelerated is avail
David Roguin
Guest

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.

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:
Quote:

On Nov 15, 2007 6:55 PM, David Roguin <nesdavid at gmail.com> wrote:
Quote:
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
how to know if (direct render) hardware accelerated is avail
David Roguin
Guest

I'm working in a graphic library for making games, I want to use
OpenGL and SDL in case that accel hardware is not available; that's
why I need to check before rendering anything in screen.

I was thinking, if I test if the GL_RENDER is Mesa, I'm sure that not
hardware accel is present. But is there another soft OpenGL
implementation besides Mesa?

David.

On Nov 16, 2007 3:35 PM, Bob Pendleton <bob at pendleton.com> wrote:
Quote:

On Fri, 2007-11-16 at 09:44 -0300, David Roguin wrote:
Quote:
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

Quote:

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:
Quote:

On Nov 15, 2007 6:55 PM, David Roguin <nesdavid at gmail.com> wrote:
Quote:
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 +
+--------------------------------------+



_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
how to know if (direct render) hardware accelerated is avail
Solra Bizna
Guest

On Nov 16, 2007 7:01 PM, David Roguin <nesdavid at gmail.com> wrote:
Quote:
I was thinking, if I test if the GL_RENDER is Mesa, I'm sure that not
hardware accel is present. But is there another soft OpenGL
implementation besides Mesa?
Ah, but here you hit another problem... Smile
Most "Free" 3D drivers report themselves as some variant of "Mesa
DRI." So, you might think you could make an exception to the rule by
checking for "DRI" in the RENDER string... but, alas, it's not that
simple, as often DRI is reported in the RENDER string despite the lack
of worthwhile hardware acceleration. (Mach64 anyone? Or the Creator3D,
on which texture mapping is not accelerated?)

All hope is not lost, though, since SDL now has a GL attribute you can
use to request hardware acceleration (SDL_GL_ACCELERATED_VISUAL). I
haven't used it, so I don't know how extensive backend support is, but
at least there's the potential. (Not to mention being
cross-platform...)
-:sigma.SB
how to know if (direct render) hardware accelerated is avail
David Roguin
Guest

It seems SDL_GL_ACCELERATED_VISUAL is what i want.

Thanks a lot for your responses.
David.

On Nov 16, 2007 5:54 PM, Solra Bizna <sbizna at tejat.net> wrote:
Quote:
On Nov 16, 2007 7:01 PM, David Roguin <nesdavid at gmail.com> wrote:
Quote:
I was thinking, if I test if the GL_RENDER is Mesa, I'm sure that not
hardware accel is present. But is there another soft OpenGL
implementation besides Mesa?
Ah, but here you hit another problem... Smile
Most "Free" 3D drivers report themselves as some variant of "Mesa
DRI." So, you might think you could make an exception to the rule by
checking for "DRI" in the RENDER string... but, alas, it's not that
simple, as often DRI is reported in the RENDER string despite the lack
of worthwhile hardware acceleration. (Mach64 anyone? Or the Creator3D,
on which texture mapping is not accelerated?)

All hope is not lost, though, since SDL now has a GL attribute you can
use to request hardware acceleration (SDL_GL_ACCELERATED_VISUAL). I
haven't used it, so I don't know how extensive backend support is, but
at least there's the potential. (Not to mention being
cross-platform...)

-:sigma.SB
_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org