Hacker News new | ask | show | jobs
by anon4 3879 days ago
Also, your game will continue working natively when linux transitions to using wayland/mir, without having to run via an X11 shim.
2 comments

This is true for the alternatives as well, approximately nobody writes raw Xlib apps in modern times.
Unfortunately most of game developers that decide against use of SDL2 do that based on their experience of Windows development where it's pretty much standard to have own code for everything (except development tools and some middleware). E.g they think that their own code going to take less lines and be cleaner than SDL.

As result these people usually don't even consider any alternatives as all of them even worse from their standpoint.

... And those developers are generally right.

I would use SDL in Linux ports of things because it is the closest to a reasonable native API on Linux (which says more about Linux than SDL actually). But even having done so I would then use native APIs in Windows, OSX, etc.

If your standard of quality is high enough, it won't really be possible to reach it using a blanket API like SDL everywhere.

It's reasonable to keep native code when you already spend months / years working with it. Or if you're huge company with hundreds of programmers that want to have own everything.

Though when it's relatively new game with own engine and small team maintenance cost for own cross platform code going to be high. Even on Windows there is tons of small problems that already solved within SDL. It's really not fun to debug problems of XP, Vista and some not updated systems.

PS: Also as far as I aware SDL2 currently used by all Valve games on all platforms. I pretty sure they wouldn't be using it if it's wasn't working well.

IIRC Valve uses SDL for some things but also goes around it and uses platform APIs for other things.
So it means you prefer SDL2 on Linux because it is the least awful. Can you elaborate why you would not use it on e.g. Windows? Which parts of it do you consider inappropriate do use it cross-platform?
Nothing on the post above is even remotely accurate.
So much explained disagreement.. not?
SDL2 also have nice SDL_DYNAMIC_API feature that let users to switch to different library version even if it's statically linked.