Various OpenGL bits

Just a couple of OpenGL questions, of varying intelligence :

  • I’m a little confused - how do I poll for hardware OpenGL surfaces only?
    = SDL_ListModes(, SDL_HWSURFACE | SDL_OPENGL)? My
    problem is that the docs are unclear and my hardware supports hardware
    OpenGL on all surfaces, so it is hard to find out empirically.

  • now that multisampling is an official OpenGL feature (as of 1.3) and not
    an extension, is there any chance of support? Please?

Thanks for any replies!

-Thomas

The SDL_HWSURFACE flag should be set only for hardware 2D SDL surfaces.
It does not effect any OpenGL attributes.

See line 585 - 588 of src/video/SDL_Video.c

is_opengl = ( ( flags & SDL_OPENGL ) == SDL_OPENGL );
if ( is_opengl ) {
/* These flags are for 2D video modes only */
flags &= ~(SDL_HWSURFACE|SDL_DOUBLEBUF);
}On Monday 26 August 2002 01:35, Thomas Harte wrote:

Just a couple of OpenGL questions, of varying intelligence :

  • I’m a little confused - how do I poll for hardware OpenGL surfaces only?
    = SDL_ListModes(, SDL_HWSURFACE | SDL_OPENGL)? My
    problem is that the docs are unclear and my hardware supports hardware
    OpenGL on all surfaces, so it is hard to find out empirically.

To the maintainer of the sdl doc (Martin?, Sam?):
Every SDL code I’ve seen lately uses SDL_HWSURFACE | SDL_OPENGL.
Perhaps something like “For 2D video modes only” should be added to
SDL_HWSURFACE and SDL_DOUBLEBUF.


Johannes Schmidt

< http://libufo.sourceforge.net > Your widget set for OpenGL

To the maintainer of the sdl doc (Martin?, Sam?):

Perhaps something like “For 2D video modes only” should be added to
SDL_HWSURFACE and SDL_DOUBLEBUF.

Or how about 'For 2D video modes only . . . to request instead modes with
hardware OpenGL support, use the flags '? And maybe someone here
might like to give a preview of just what those flags would be? :slight_smile:

-Thomas

To the maintainer of the sdl doc (Martin?, Sam?):

Perhaps something like “For 2D video modes only” should be added to
SDL_HWSURFACE and SDL_DOUBLEBUF.

Or how about 'For 2D video modes only . . . to request instead modes with
hardware OpenGL support, use the flags '? And maybe someone here
might like to give a preview of just what those flags would be? :slight_smile:

You can’t portably query for hardware accleration in OpenGL.
Different vendors may provide different partially accelerated pipelines.
The difference is more in the OpenGL calls you use, rather than the video
mode you select. In general, if you can set the video mode, you can use
OpenGL in that mode, but whether you use tri-strips or fans (for example)
would determine whether the hardware can accelerate the operations you
want.

You should always perform a run-time test of the GL operations you use
and see if the speed is acceptable. If you support multiple codepaths,
you should run them all and see which is faster in a configuration phase
of your application initialization.

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

Hmm, wasn’t too precisely last time.

There are no such flags for OpenGL.
This depends on your OpenGL library.

If you link with a pure software renderer, you will (most likely) get
software buffers.
If you link with a hardware accellerated OpenGL implementation, you will
(most likely) get hardware buffers.

See test/testgl.c for a example of SDL + OpenGL.

Hope this helps :)On Monday 26 August 2002 16:35, Thomas Harte wrote:

To the maintainer of the sdl doc (Martin?, Sam?):

Perhaps something like “For 2D video modes only” should be added to
SDL_HWSURFACE and SDL_DOUBLEBUF.

Or how about 'For 2D video modes only . . . to request instead modes with
hardware OpenGL support, use the flags '? And maybe someone here
might like to give a preview of just what those flags would be? :slight_smile:


Johannes Schmidt

< http://libufo.sourceforge.net > Your widget set for OpenGL

There are no such flags for OpenGL.
This depends on your OpenGL library.

Hmmm. Okay. You’ll understand my confusion - my non-SDL work with OpenGL has
all been on the Windows platform, where such work is possible.

Perhaps for a future release there could be a way of asking for modes that
are definitely hardware accelerated, and for modes for which hardware
acceleration cannot be determined. On platforms like Windows, the former
will be able to return useful information while the latter returns no modes,
on platforms where this information is not available, the latter will just
return all of the available OpenGL modes and the former would return no
modes.

-Thomas

Perhaps for a future release there could be a way of asking for modes that
are definitely hardware accelerated, and for modes for which hardware
acceleration cannot be determined. On platforms like Windows, the former
will be able to return useful information while the latter returns no modes,
on platforms where this information is not available, the latter will just
return all of the available OpenGL modes and the former would return no
modes.

Sounds good to me. :slight_smile:

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