Not using SDL for video

Is it possible/sane to use SDL for events and WM stuff but not
for video?

In the past months I’ve developed a sprite engine which powers
our Betty’s Beer Bar (http://www.mrio-software.com/info.php?id=bbb).
It uses SDL for everything.

Now I want to modularize the library a bit and add different
"video drivers". These would be high level “drivers”, since their
interface would be about sprites. One of the drivers, which is the
current implementation, will use SDL for everything and do dirty
rect management. But I also want to do a SDL/OpenGL driver and
a Direct3D driver (mostly because I want to use the current sprite
library for the GUI of a 3D game).

In this scheme of things, I’d use SDL for events and surface loading/
compositing and Direct3D to draw the actual quads. Is this possible?
Is this sensible?

Thanks,
–Gabriel

SDL already has the ability to draw on an OpenGL surface – if you want to
see example code, I’d suggest grabbing the NeHe SDL Basecode off of
http://nehe.gamedev.net/ (it’s on the left side, about half way down the
page – you’ll see the word “basecode” about 9 times) – I believe it demos
drawing in OpenGL 3d, and using SDL to place sprites rotating around on the
2d foreground. Also, alot of his tuts have SDL ports that you can download.

I’m not 100% sure about Direct3D (as I have never tried it before), but I
believe SDL has the capabilities to draw to a DirectDraw surface, but I’m
not positive that Direct3D uses a DirectDraw surface, or even if you could
get a hold of it if it did. Somebody with more knowledge of SDL/DirectX
please post too.

  • Silicon> ----- Original Message -----

From: ggambett@artech.com.uy (Gabriel Gambetta)
To:
Sent: Monday, December 01, 2003 8:41 AM
Subject: [SDL] Not using SDL for video

Is it possible/sane to use SDL for events and WM stuff but not
for video?

In the past months I’ve developed a sprite engine which powers
our Betty’s Beer Bar (http://www.mrio-software.com/info.php?id=bbb).
It uses SDL for everything.

Now I want to modularize the library a bit and add different
"video drivers". These would be high level “drivers”, since their
interface would be about sprites. One of the drivers, which is the
current implementation, will use SDL for everything and do dirty
rect management. But I also want to do a SDL/OpenGL driver and
a Direct3D driver (mostly because I want to use the current sprite
library for the GUI of a 3D game).

In this scheme of things, I’d use SDL for events and surface loading/
compositing and Direct3D to draw the actual quads. Is this possible?
Is this sensible?

Thanks,
–Gabriel


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.541 / Virus Database: 335 - Release Date: 11/14/2003

SDL already has the ability to draw on an OpenGL surface

I know. That’s why I said one of my backends would be SDL/OpenGL.

I’m not 100% sure about Direct3D (as I have never tried it before),
but I believe SDL has the capabilities to draw to a DirectDraw surface

Yes, it has a DirectDraw port.

but I’m not positive that Direct3D uses a DirectDraw surface, or
even if you could get a hold of it if it did.
Somebody with more knowledge of SDL/DirectX please post too.

Well… that’s the part I don’t know either :slight_smile:

Thanks,
–Gabriel

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy