[SDL] glSDL and OpenGL at the same time

Olivier Delannoy olivier.delannoy at gmail.com
Fri Sep 2 00:48:56 PDT 2005


On 9/1/05, David Olofson <david at olofson.net> wrote:
> 
> On Thursday 01 September 2005 09.20, Olivier Delannoy wrote:
> > I am currently the main user of this system and I am not interested
> > in learning multiple GUI or in multiplying modules.
> 
> That's a good reason for using glSDL - you need only the SDL 2D API.
> 
> 
> > Using glSDL implies OpenGL and it's a requirement that did not
> > bother me at all.
> 
> Actually, glSDL just *allows* you to use OpenGL - CEGUI would be what
> adds the OpenGL *requirement*.
> 
> If you don't activate glSDL, SDL just uses the default 2D backend
> instead. (Or, in the case of the old wrapper; glSDL passes the
> affected calls through to SDL instead of "redirecting" them to
> OpenGL.)
> 
> 
> > That's why I am really interested in trying to link glSDL to CEGUI.
> 
> I see. Well, it *should* work with current versions of glSDL, but you
> have been warned; mixing glSDL and OpenGL is not officially
> supported. There is a risk of future versions of glSDL breaking your
> code if you do this.
> 
> 
> [...]
> > My first idea was to load and use glSDL and to add the drawing of
> > cegui right after glSDL. I am not sure if it's the good way to do
> > thing.
> 
> Well, as it is, glSDL basically just translates every SDL blit into an
> OpenGL "blit", instantly, one by one. As long as you do the SDL and
> OpenGL calls in the right order, they should also be rendered in that
> order. (In current versions of glSDL, that is. Been thinking about
> buffering and doing batch rendering in some way, but I'm not sure
> it's worth the effort.)
> 
> Use SDL_Flip() instead of SDL_GL_SwapBuffers()! (I *think*
> SDL_GL_SwapBuffers() would work with current versions of glSDL, but
> don't be surprized if it doesn't.)
> 
> Finally, keep in mind that glSDL assumes that it's not sharing OpenGL
> with anyone, so it will set up matrices and stuff the way it wants
> them and then assumes they'll stay that way. If you need to change
> certain things, you need to restore them before making further glSDL
> calls. Read the glSDL source for details.
> 
> 
> //David Olofson - Programmer, Composer, Open Source Advocate
> 
> .- Audiality -----------------------------------------------.
> | Free/Open Source audio engine for games and multimedia. |
> | MIDI, modular synthesis, real time effects, scripting,... |
> `-----------------------------------> http://audiality.org -'
> --- http://olofson.net --- http://www.reologica.se ---
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
> 
Thanks I will try and give some feedback here.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050902/7ee47dab/attachment-0008.htm>


More information about the SDL mailing list