Slashdot Log In
Game Programming w/ the Simple Directmedia Layer?
Posted by
Cliff
on Wed Apr 04, 2001 05:41 PM
from the stuff-to-talk-about dept.
from the stuff-to-talk-about dept.
wrinkledshirt asks: "I've just started programming with SDL for a game I've been wanting to make for a long time, and I've been making really quick work of it. The libraries and API are excellently designed and the project documentation is great. After banging my head against DirectX and even OpenGL for a while, this comes as a great relief, and I love the fact that my game will eventually run on Linux (and Windows, and FreeBSD, and Be, and MacOS, etc.). Still, I'm really early on in development, and even though I haven't had any problems yet, I'm wondering if I will, namely in performance. My question is this, how many programmers out there are tinkering or hacking or professionally coding with the SDL? How does it perform as the project gets bigger? How does it rank as a game programming library? Will it eventually be Linux's answer to DirectX?"
This discussion has been archived.
No new comments can be posted.
Game Programming w/ the Simple Directmedia Layer?
|
Log In/Create an Account
| Top
| 163 comments
(Spill at 50!) | Index Only
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
See Loki. (Score:5)
Check out Loki [lokigames.com], since they wrote (or at least have done heavy development) on SDL exactly for the purpose of porting "professional" games. Get some of their demos; buy some of their games. Just last week or so I got Descent 3, Terminus, and Soldier of Fortune (for about $10 each from ebgames [ebworld.com].. can't pass up a deal like that), and am highly impressed with the quality. Pop in the SoF CD, run the cute little graphical installer, and go. It works. Flawlessly. Terminus too. (Actually that's slightly inaccurate, there were some minor GL problems with the G400 drivers in 32bpp mode that came up later, but switching to 16bpp seemed to fix them.) D3 I have problems with, related again to the XFree86 4.x G400 drivers, but still.
I've played some of their demos as well, and they're equally solid and polished. The SDL stuff is where it's at. Loki has proven it works for "real" games. The API and related packages you can get are great. Easy to install, easy to code for, flexible, Free(tm), portable, proven. What more could you ask for?
Just look at the games ... (Score:3)
Your game will probably encounter the same set of parameters in its lifecycle as some of the games on this list:
http://www.libsdl.org/games_db/games.php3">>Lib
So, use them as a good yardstick for your own works...
j.
Re:What about force-feedback? (Score:3)
Re:It was developed for use in commercial games (Score:3)
But, yes, as mentioned elsewhere, Sam owns most of the copyright.
m.
aalib. (Score:3)
--
Re:Now if I only had an idea......... (Score:5)
Bees need to be allocated to: gathering nectar, building the nest, taking care of larvae, taking care of the queen, sitting at the entrance of the hive fanning their wings to cool it, defend the hive, mating, dancing, doing John Belushi killer bee imitations.
Disasters can include: disease, famine, death of flowers, honey bears, kids throwing rocks, queen dies, pesticides.
Allocate the wrong bees in the wrong amounts to the wrong jobs, and the batch of honey goes bad and everyone dies. Figure out how to relate to kids that this complicated balance of things is handled with great skill by unintelligent insects coordinating instinct and movement, bringing us a delicious breakfast treat.
What about force-feedback? (Score:5)
SDL Tutorial (Score:4)
Check out part1 [lugod.org], and then part2 [lugod.org].
Be warned.. it's a bit dated. But it should be useful for the SDL-hacker-wannabe's
I'm no SDL expert (Score:3)
I would think that it would be the game programmer's API by game programmers. Loki uses if for their stuff and that's proof enough to me that it's good.
There are lot's of things that use it also.
Now if I only had an idea......... (Score:5)
Anyone have any cool ideas for an educational game? 3D Zoombeanies? A FPS Algebra tutorial?
SuperID
Free Database Hosting [freesql.org]
Re:You're kidding, right? (Score:3)
-- Dan Kegel [kegel.com]
SDL+OpenGL+GTK+=Sweet set of APIs (Score:3)
Using SDL, OpenGL and GTK let me get an app up and running, with hardware-accelerated 3D in no time at all.
In this case, the GTK parts of the system are in a separate window - a 'control panel' type thing, and SDL/OpenGL simply handle drawing the 3D window. I'm not sure how well GTK and SDL/OpenGL interoperate when used in the same window.
GTK quite happily interoperates with an SDL event loop, which i use for mouse/keyboard events in the 3D window.
I couldn't be happier with SDL, and i reccommend it highly.
Game Programming with SDL (Score:4)
One of the best judges of an API's efficiency is the success of programs using it. Looking over the list [libsdl.org] is somewhat impressive. But most of the popular games are Loki Ports, and they've had a lot of experience with SDL already. I see very few popular non-Loki games on the list.
I think you can conlude two things from this. First, it's possible to get reasonable performance from SDL, and it's definitly a reasonable API. Second, SDL just doesn't have the same support community size as OpenGL or DirectX. I suspect that the biggest barrier to graphics programming is *not* how often you run into trouble with the API, but how many other people can help you out when trouble occurs. No matter what API you use, you *will* have issues to deal with. So the smaller community size is probably the biggest obstical that SDL has to overcome.
-Ted
SDL 1.3 is coming (Score:5)
I haven't done any large projects in SDL, but I've heard the performance is quite good as Loki uses it for their porting efforts. Hey if it's good enough for commercial games.. er..
One thing you should keep in mind is that SDL is currently undergoing a complete rewrite and architecture change for SDL version 1.3 which will include the SDL 2.0 API. It's currently a year and a half from stable release (says cheif SDL ninja Sam Lantinga), so it's a long time to wait but you might want to keep that in mind as you are designing your project.
SDL Is excellent... (Score:3)
The limiting factors of SDL performance are not really SDL itself, because it is a very light API, but rather the limitations of X itself. My experience with SDL is that it provides at most a 2% performance degredation.
Furthermore, SDL is a wonderful cross-platform library that I have used extensively under both Windows and Linux. They also provide a cross compiler that lets you compile a windows executable under linux!
If you are considering SDL for 2D programming, I can say it is probably the best out there for speed, portability and ease of use. If you want to do 3D programming, you can either use SDL or some of the others out there, like plib [sourceforge.net].
--
Twivel
It was developed for use in commercial games (Score:3)
SDL was developed by Loki to simplify their own job - porting standard commercial games from Windows to Linux. Thus, it's already being used for "professional" project with cutting-edge, commercial games and is proven technology - at least on the Linux platform.
cross-platform compiling (Score:4)
SDL is just a buffer. (Score:5)
It's a buffering layer with access to acceleration when necessary. There are other libraries that assist it for the actual, well, game stuff.
SDL pretty much does all this:
This really isn't a game development library by itself: There are no image loaders, nor are there any image rotation/flip code, nor are there.. well, alot of things you'd need for a 2D game. There are other, supplemental libraries for this:
There are also a few rendering and UI libraries in the works. There may even be a few finished, I'm really not sure. But, if you're going to use SDL for game development, don't expect it to do _everything._
But if you're developing one, it's probably better to get your hands dirty and learn how to do the rendering stuff yourself anyway. It's not really all that hard: I've got a bunch in mine. [sandwich.net] Digging out Abrash's book, which was recently posted here, should help with some of the other renderers (polygonal, bresenham, etc.) that are fairly interesting.
Cross Language Too (Score:5)
As the maintainer of pygame, the python binding, I believe it is one of the furthest along. This week will mark the release of pygame-1.0, and there is already a good community forming, (and projects being released).
Check out pygame at http://pygame.seul.org [seul.org].
sdl info (Score:4)
You could have found this out too, if you had simply looked at the code instead of "Asking Slashdot".
Did you say OpenGL? (Score:4)