What kind of game can be made with just SDL?

Ok, I am going to give up on OpenGL, since I can’t see to write a dam .tga loader correctly and get textures. So I need to know what SDL can do on its own? Is it possible to do a Starcraft or Total Annihilation style game in SDL? I know TA has 3d units but I would probably just use a top down view since SDL is 2d only. Also using alpha channel is that going to cause a huge performance loss in SDL? I used it in OpenGL and seem to be fine? That was when I was on a Mac but now I am back on a PC, and not using QuickTime to load my textures. Thanks

Ok, I am going to give up on OpenGL, since I can’t see to write a dam
.tga loader correctly and get textures.

Doesn’t seem like a good reason to give up to me. :slight_smile: Just grab one of
the examples of using SDL_image to load OpenGL textures posted on this
list. If you happen to get a non-portable one, you can just fix it or
replace it later.

So I need to know what SDL can
do on its own?

Basically anything, as long as you have reasonable performance
requirements… It’s all software rendering on many target, and alpha is
done only in s/w on all targets. (Except glSDL, which uses OpenGL for all
blitting to the screen, but that’s not yet a part on SDL.)

Despite all the whining about performance lately, SDL is about as fast
as it gets on top of 2D APIs - and that’s pretty damn fast, especially if
you aren’t going to smooth scroll the whole screen all the time.

Is it possible to do a Starcraft or Total Annihilation
style game in SDL?

Of course. Not my kind of games really, but I think there are several
games with that kind of graphics running on top of SDL already.

I know TA has 3d units but I would probably just use
a top down view since SDL is 2d only.

Your screen can only display 2D images, right? (Well, even if you have
one of those “3D” panels, it’s just displaying two 2D images; one for
each eye. Still not real 3D, that is.)

“3D” in gaming does in fact mean “projection of a 3D world onto a 2D
screen”. You can implement this in many way, and all of them can be
implemented in software, even if some methods would be incredibly slow on
any normal CPU.

Look at Doom for a method that is incredibly fast. ZDoom is a
particulary fast version, especialy the last beta, which makes use of
system memory + busmaster DMA transfers. (My suggestion, actually. :slight_smile:

Also using alpha channel is that
going to cause a huge performance loss in SDL?

No, not unless you do it all over the screen, all the time. It’s not like
using alpha blending changes the whole SDL to a lower gear - the
performance hit is only for the pixel that are actually blended.

BTW, Kobo Deluxe relies heavily on the alpha blending and RLE
acceleration of SDL, and still runs pretty well in “software mode” even
in higher resolutions.

http://olofson.net/skobo

Indeed, it does run a lot smoother with glSDL, but that’s besides the
point. Kobo Deluxe is an extremely fast paced scrolling shooter (if you
disagree, wait till you’re beyond stage 100… :-); not a strategy game.

I used it in OpenGL and
seem to be fine?

Yes, because virtually any 3D card worth having in a machine accelerates
alpha blending in h/w at a minimal cost.

In software, the difference between straight blitting and alpha blending
is much bigger, as general purpose CPUs just aren’t built for that kind
of work.

That was when I was on a Mac but now I am back on a
PC, and not using QuickTime to load my textures. Thanks

SDL_image will load images just fine with a single line of code, and then
all you need is a few lines of code that has been posted on this list
several times in various versions. Aren’t there some links in the FAQ?

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Friday 08 March 2002 05:46, Mars_999 wrote:

An embedded and charset-unspecified text was scrubbed…
Name: TEffekt.h
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020308/fc9bec3b/attachment.asc
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: FileLoader.h
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020308/fc9bec3b/attachment.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: FileLoader.cpp
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020308/fc9bec3b/attachment-0001.asc