glSDL and OpenGL

Just a thought, but would it be possible to include a set of OpenGL
functions (basically just wrappers) within glSDL that would allow the
use of OpenGL calls along with glSDL? Optional, of course.

Yes, but why complicate things? All you need is one or two glSDL
specific calls, to flip OpenGL between glSDL and application states.

You could even get away with just checking what glSDL does, and make
sure your application deals with it - but I wouldn’t recommend that
approach. It might break if you switch to another glSDL version. (And
that’s beyond your control if/when glSDL becomes an SDL backend.)

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Tuesday 25 February 2003 20.36, Calvin Spealman wrote:

Just a thought, but would it be possible to include a set of OpenGL
functions (basically just wrappers) within glSDL that would allow
the use of OpenGL calls along with glSDL? Optional, of course.

David Olofson wrote:> On Tuesday 25 February 2003 20.36, Calvin Spealman wrote:

Just a thought, but would it be possible to include a set of OpenGL
functions (basically just wrappers) within glSDL that would allow
the use of OpenGL calls along with glSDL? Optional, of course.
Yes, but why complicate things? All you need is one or two glSDL
specific calls, to flip OpenGL between glSDL and application states.

The flipping thing seems best, I was just curious and thinking along the
lines of not changing any API’s in glSDL. As wrapping the OpenGL
functions would make it completely compatible with code not using glSDL
originally. which brings up another question i just had, if i have a
binary that links to an SDL shared library, can i just replace that
shared library with glSDL?

specific calls, to flip OpenGL between glSDL and application states.

The flipping thing seems best, I was just curious and thinking along the
lines of not changing any API’s in glSDL. As wrapping the OpenGL
functions would make it completely compatible with code not using glSDL
originally. which brings up another question i just had, if i have a
binary that links to an SDL shared library, can i just replace that
shared library with glSDL?

Hi,

you can replace it if they are binary compatible, not only the API have to
be the same (functions) but the data structures have to be compatible too.
Anyway SDL don’t rely too much on data structures at an API level, so my
guess is that it’ll work if the aplication don’t make something strange with
the SDL data structures (surfaces, pixels…)

hope this helps,
ciao
Dr.Slump

----- Original Message -----
From: calvin@ironfroggy.com (Calvin Spealman)

David Olofson wrote:

Just a thought, but would it be possible to include a set of
OpenGL functions (basically just wrappers) within glSDL that
would allow the use of OpenGL calls along with glSDL? Optional,
of course.

Yes, but why complicate things? All you need is one or two glSDL
specific calls, to flip OpenGL between glSDL and application
states.

The flipping thing seems best, I was just curious and thinking
along the lines of not changing any API’s in glSDL. As wrapping the
OpenGL functions would make it completely compatible with code not
using glSDL originally.

Both methods involve adding function calls, so they’re equally “bad”
in that regard. The advantage with the “state flipping” solution is
that it doesn’t interfere with the way the application calls OpenGL.

which brings up another question i just
had, if i have a binary that links to an SDL shared library, can i
just replace that shared library with glSDL?

No, not at this point. glSDL is an application side wrapper for SDL,
and cannot be built as a library. It requires that the application is
recompiled, including glSDL.h instead of SDL.h. The current
implementation is little more than a proof-of-concept hack.

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Wednesday 26 February 2003 04.03, Calvin Spealman wrote:

On Tuesday 25 February 2003 20.36, Calvin Spealman wrote:

specific calls, to flip OpenGL between glSDL and application
states.

The flipping thing seems best, I was just curious and thinking
along the lines of not changing any API’s in glSDL. As wrapping
the OpenGL functions would make it completely compatible with
code not using glSDL originally. which brings up another question
i just had, if i have a binary that links to an SDL shared
library, can i just replace that shared library with glSDL?

Hi,

you can replace it if they are binary compatible, not only the API
have to be the same (functions) but the data structures have to be
compatible too.

A compile time wrapper cannot be binary compatible with a shared
library. :slight_smile:

glSDL doesn’t change any SDL structs, though. It just uses the
‘unused1’ field of SDL_Surface - and as of 1.2.5, SDL initializes
this field, to avoid trouble with add-on libs that call SDL directly
to create surfaces.

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Wednesday 26 February 2003 05.05, Iv?n Montes wrote:

----- Original Message -----
From: “Calvin Spealman”