3
\$\begingroup\$

As I understand, SDL offers abstractions that let you make windows, handle input and audio much easier than doing so directly with the low level APIs provided by several operating systems.

However, it seems that a lot of games, both indie and AAA, don't use it, and I would like to know why. This makes me suspect that there may be areas where SDL is lacking, such as features, performance, or robustness, when compared to platform-specific APIs.

Apart from platform support, that is, considering only the platforms SDL supports, I do not understand what would keep a developer from using SDL for their game, since I feel like, based on my admittedly limited knowledge, it'd be much smarter to use SDL on the platforms that do support it.

\$\endgroup\$
  • 1
    \$\begingroup\$ SDL in contrast to what? High-level frameworks (e.g. XNA, Love2D, Pixi.js) or low-level tooling (e.g. OpenGL, DirectX, X11)? \$\endgroup\$ – Anko Jul 13 '14 at 9:40
  • \$\begingroup\$ Low-level stuff. Using OpenGL and/or DirectX for rendering, and using SDL for window/input/audio handling. \$\endgroup\$ – Jay Abelter Jul 13 '14 at 10:03
  • \$\begingroup\$ Similar discussion at When to roll your own game engine?. \$\endgroup\$ – Anko Jul 13 '14 at 10:12
  • \$\begingroup\$ It's all a matter of preference. Just as it seems completely outrageous not to use SDL to you, it seems completely outrageous to use SDL to others. \$\endgroup\$ – Panda Pajama Jul 13 '14 at 10:49
  • 1
    \$\begingroup\$ @JayAbelter: I downvoted this question because as it is written, it seems like spam, kinda like "Is there any reason not to use (random weight loss pill)?, don't people want to like, lose weight?". Now, assuming good will (I currently don't), the reason people don't use SDL is the same reason you don't use XNA, Unity, Ruby, or whatever other product: because you don't deem it appropriate for your project. 1000 people who don't use SDL will give you 1000 different reasons, in which case this would be an opinion poll, and therefore inappropriate for this site. \$\endgroup\$ – Panda Pajama Jul 13 '14 at 12:28
1
\$\begingroup\$

SDL introduces an additional dependency

While many platforms support it, it is not a part of the regular distribution of all of those platforms, so users must download and install it themselves. One such platform is Windows, and assuming that your target market is divided in proportions similar to the Steam Hardware Survey, that means that ~95% of your potential users probably don't have SDL.

If you're dependent on users downloading and installing SDL correctly themsleves, you will get burnt. You'll encounter problems such as users failing to get the correct version, failing to get the DLLs into the correct directories, incorrectly mixing 32-bit SDL with 64-bit programs (or vice-versa), and potentially causing version-conflicts with other programs that may use SDL. All of those will cause you support headaches and generate a bad reputation for your program.

The solution to this is knowledge, of course. Not on the part of your users (nobody ever reads readme files) but on your part. You need to know that this can be a problem, and you need to package the correct SDL binaries with your program's installer, then install them in your program's own directory so as to avoid conflicts with other programs. Either you're prepared to go this route or you risk problems for ~95% of your potential users.

\$\endgroup\$
  • 2
    \$\begingroup\$ Doesn't static linking completely solve this problem? \$\endgroup\$ – Jay Abelter Jul 13 '14 at 14:12
  • \$\begingroup\$ Ironically literally everyone who completes the Steam hardware survey has SDL installed, because Steam uses it. \$\endgroup\$ – Alistair Buxton Dec 19 '14 at 1:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.