SDL versus Direct X

Started by
5 comments, last by cxi2 23 years, 6 months ago
ok ok I need to know your guys'' opinions: have you used SDL? what do you think is better for 2d game creation, SDL or Direct X??? Why do you say that???? Thanks Guys to Code, or Not To Code
to Code, or Not To Code
Advertisement
I, too, would like to know some views from people that have actually used SDL... I''ve looked at it, but haven''t used it.

What I do know, is that SDL is cross-platform, which makes it better than the proprietarily-Windows DirectX in my mind. I don''t know what kind of hardware support or speed you get with SDL, though, and I''d like to see what other people have to say about that.
Greenspun's Tenth Rule of Programming: "Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
First yes I have used SDL for a demo project. SDL has the option to use DirectX for it''s 2D work so it''s somewhat of a moot point. If you want cross-platform without a fuss or just a higher level API then SDL is a good choice. If you feel the need to twiddle every last bit and don''t care about cross-platform then DirectX is your bet. As with any API that is layered over another, I would expect a performance benefit from raw DirectX, although I expect it will be small.

Philo
I''ve used SDL quite a bit over the past year.

From my experience, here''s the pros:

Cross-platform support. This is the major pro, of course. This is more or less reason enough for me to use it.

Some nice library support. SDL_ttf, SDL_image, SDL_mpeg, SDL_mixer, etc. These allow you to use true-type fonts, many image formats, MPEG (video and audio, including MP3) and other technologies within your SDL program with very little effort. And of course, since the libraries are built on SDL they get the cross-platform benefits of SDL itself.

Very nicely designed API that hides just enough from the programmer without losing too much efficency and power. For example, SDL allows you to work directly with ''surfaces'' ala DirectDraw, but whether the underlying structures are DirectDraw surfaces, GDI bitmap data, or whatever doesn''t have to be known by the program using the API. And SDL will intelligently fall-back if needed (if user doesn''t have DirectX installed, it will use GDI/DIBs, etc..).


There have been some cons...But generally these are pretty minor. They include:

Documentation has been really spotty in the past. This has been changing a lot relatively recently, though and newer releases have a fairly good set of documentation though its rarely totally up to date with the library...This is pretty understandable since the library is still in active development.
Also, since SDL has a very active, supportive and searchable mailing list (with useful nntp news mirrors) and you get the source code to the entire library, this isn''t as much of a problem as it might be otherwise.

Support for mixed 2D/3D isn''t nearly as nice as using DirectDraw and Direct3D together. Newer versions of SDL have been addressing this problem by adding support for OpenGL, but there''s still a few holes and performance problems that will most likely eventually be worked around soon.
ummm, whats SDL?

  Downloads:  ZeroOne Realm

Simple DirectMedia Layer.

www.libsdl.org

Basically its an API similar to the functionality of DirectX (DDraw, DSound, DInput, etc) but cross-platform, using platform-specific APIs (like DX on Win32) to do the dirty work when possible.
Yes the documentation sucks. I have had severe problems trying to get the event manager in SDL to work properly ( using win 32 ).I finally emailed the programmer himself and asked what the hell to do... his response was "play around with it until you get it right" ... yea thanks for the help man, I think i will use DirectINput then.

I only want to make a tile based game, so i figured an easy to use API would be the best. However I recently discovered taht only 8 bit color modes use palettes... so I am having a problem trying to figure out how to do a fade in/out routine. uhg....



to Code, or Not To Code
to Code, or Not To Code

This topic is closed to new replies.

Advertisement