Slashdot Mirror


Game Programming w/ the Simple Directmedia Layer?

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?"

7 of 163 comments (clear)

  1. See Loki. by oGMo · · Score: 5

    Check out Loki, 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.. 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?

    --

    Don't think of it as a flame---it's more like an argument that does 3d6 fire damage

  2. Re:Now if I only had an idea......... by PD · · Score: 5

    Make a little beehive simulation. Like a SimBeehive.

    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.

  3. What about force-feedback? by leperjuice · · Score: 5

    I wondering if there is any support for force-feedback devices under *nix. DirectInput is the layer under DirectX that handles communicating with the control devices (including force-feedback signals), but I wonder if SDL (or anything on *nix for that matter) supports anything of the sort...

    --

    -- "I am disrespectful to dirt. Can you not see that I am serious!"

  4. Now if I only had an idea......... by superid · · Score: 5
    So many tools, so little creativity :)

    Anyone have any cool ideas for an educational game? 3D Zoombeanies? A FPS Algebra tutorial?


    SuperID

    Free Database Hosting

  5. SDL 1.3 is coming by jidar · · Score: 5

    Firstly I heartily agree that SDL is a dream to program in, I love it.

    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.

    --
    Sigs are awesome huh?
  6. SDL is just a buffer. by Patrick+McCarthy · · 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:

    • Handles the video buffer, as well as GL contexts
    • Image blitting, with alpha (this does not include loading/saving)
    • Keyboard, mouse, and joystick input
    • A threaded audio buffer ('pull' model)
    • Limited CD access
    • Timers
    • File i/o handlers
    • Accelerates any of the above when applicable.
    • Probably a few I've forgotten.

    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:

    • SDL_image - A wide assortment of image loaders. Nothing to save with, though.
    • SDL_mixer - Libmikmod, smpeg, ogg vorbis, and timidity. In other words, plays every sound file known to man, links into the audio buffer.
    • SDL_net - Portable networking library (haven't tested it myself)

    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. 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.

  7. Cross Language Too by shredwheat · · Score: 5

    While thinking about the cross-platform abilities of the SDL library, don't also forget the cross-development-language options that are available. Currently there are bindings (at various levels of progress) for Ada, Eiffel, Euphoria, ML, OCaml, Perl, and Python.

    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.