-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|535|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
HoboBen
Created : 24 November 2010
Edited : 24 November 2010
System : Windows

Problems with SDL

Warning: rant

Here's my non-consructive criticism of SDL


  • SDL redefines C's main() to something else. WTF! This is also undocumented and completely counter-intuitive. Also your program won't work on windows unless you undo it.

  • If you're interested in how something is implemented by SDL, e.g. for performance considerations or because something isn't working, you might look at SDL's source code. You'll wish you hadn't. It's cramped and the preprocessor is abused like [insert distasteful simile]. It's not the worst code in the world, but it's not clean or clear and it's not clear how the preprocessor definitions in one file affect the code in another.

  • Installing SDL libraries such as SDL_image and having them actually work is impossible. Don't even think about repeating the process again for a different platforms. Alternative: nothings.org/stb_image.c

  • Documentation is a wiki, and most of the articles are replaced with spam. And there's two wikis, so god knows which one you're meant to use (if not both at the same time). One of them has a terrible interface for viewing old revisions, which you'll need to do if it's spammed - just try and pick the correct confusingly-named 12x12 pixel gif

  • There's no easy-to-use "Pixel" function. And there doesn't seem to be a reason for the omission. Additionally, pixel access seems broken. None of the examples work; the program crashes. Instead you'll have to use SDL_Rect to draw 1x1 rectangles.



I will say though, it's fast and it's cross platform. So's GLFW, though.

 

Comments