[PATCH] SDL_Surface hardware info?

Stephane Marchesin wrote:

Yup, SDL uses OpenGL for 3D (or rather, it lets you use OpenGL yourself).

I’ve started investigating the detection of slow OpenGL visuals. Under
windows, you seem to have to use WGL_ARB_pixel_format and under X you
want to use GLX_EXT_visual_rating.

What do people think of extending SDL_GL_GetAttribute with a new
read-only attribute, for example SDL_GL_SLOW_VISUAL ?
For example we could return 1 when the visual is slow, 0 when it
isn’t, and -1 when we don’t know.

Also, does anyone know how to get this information on other platforms ?

Ok, here is a first patch implementing this idea (the SDL_GL_SLOW_VISUAL
attribute is read-only, since I suspect making it read-write could
change the behaviour oif existing apps). The windows version is untested
but compiles :slight_smile:

Still no one for the other platforms ?

Stephane

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: sdl_slowvisual.patch
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20041024/f43f4de4/attachment.txt

Hi,

Very useful patch, thanks, I wish it was in CVS.> Ok, here is a first patch implementing this idea (the SDL_GL_SLOW_VISUAL

attribute is read-only, since I suspect making it read-write could
change the behaviour oif existing apps). The windows version is untested
but compiles :slight_smile:

Still no one for the other platforms ?


Best regards,
Dmitry Yakimov, ISDEF member
ActiveKitten.com

Dmitry Yakimov wrote:

Hi,

Very useful patch, thanks, I wish it was in CVS.

It’s nice that it works under windows.
I’ll try to do a new version that also works on OS X.
I also think the flag can be made read-write if I take a little extra care.

Sam, what do you think about this idea ? Is it worth pursuing ?

Stephane

Dmitry Yakimov wrote:

Hi,

Very useful patch, thanks, I wish it was in CVS.

It’s nice that it works under windows.
I’ll try to do a new version that also works on OS X.
I also think the flag can be made read-write if I take a little extra care.

Sam, what do you think about this idea ? Is it worth pursuing ?

What would probably be more useful is a flag to setting the video mode
to fail if hardware accelerated rendering isn’t available. It’s a little
fuzzy in that it’s possible for certain applications to run OpenGL well
over the network under X11, and conversely even if OpenGL may be accelerated,
your app may require shaders that are not supported.

-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sam Lantinga wrote:

Sam, what do you think about this idea ? Is it worth pursuing ?

What would probably be more useful is a flag to setting the video mode
to fail if hardware accelerated rendering isn’t available.

Yes, I was thinking of changing to SDL_GL_SLOW_VISUAL to
SDL_GL_ACCELERATED_VISUAL.
That way it would be possible to force a hw accelerated visual.

It’s a little
fuzzy in that it’s possible for certain applications to run OpenGL well
over the network under X11, and conversely even if OpenGL may be accelerated,
your app may require shaders that are not supported.

Well, the purpose of this is not to find out whether the current
platform has accelerated rendering (it seems pointless to me because
this is nothing that can be solved by the application ; for example the
application is not able to disable indirect rendering) but rather be
able to avoid OpenGL visuals that resort to software emulation. This
makes sense for interactive applications that only want to use some
visual features if they are accelerated (like stencil buffers, floating
point buffers, multisample buffers, accumulation buffers, …)

Stephane

Well, the purpose of this is not to find out whether the current
platform has accelerated rendering (it seems pointless to me because
this is nothing that can be solved by the application ; for example the
application is not able to disable indirect rendering) but rather be
able to avoid OpenGL visuals that resort to software emulation.

Don’t we always want to avoid those visuals?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sam Lantinga wrote:

Well, the purpose of this is not to find out whether the current
platform has accelerated rendering (it seems pointless to me because
this is nothing that can be solved by the application ; for example the
application is not able to disable indirect rendering) but rather be
able to avoid OpenGL visuals that resort to software emulation.

Don’t we always want to avoid those visuals?

Dependeing on the application you might want to. If you’re doing real
time rendering, you’ll probably want to.
But for example if you’re doing high quality non real time rendering,
there’s no reason to avoid these since you’re not concerned about speed
but surely need the features for quality.

The whole idea is to let applications have the choice : either have the
visual features or have the rendering speed.

Stephane