Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have nothing against the SDL project. I have everything against the DirectMedia style api of 1997. I get that people are actively developing with it and that roadmap towards 3.0 is getting close but my experience is it’s designed for legacy games, legacy rendering styles, legacy ABI’s. No one is shipping games for Dreamcast or PS2.

2/3rds of the library is dead code when working with Vulkan.



TIL Unreal 5 based games were "legacy"


They really only use it for Linux window and audio because there’s so many ways to skin a disto.


They definitely use it for more than that, because I'm sure I've seen it ship with Windows games as well.

Also there's exactly 2 ways to get a window on Linux, and those 2 ways are common to pretty much every modern distro. Same as audio.


What is a better alternative?


For what? Working with Vulkan? Or a windowing library? Personally I use a mix of glfw and native windowing on mobile, which is surprisingly simple for a gfx context window and this gets me to triangle.

SDL2 is about the same amount of boilerplate code only in SDL_Thing form.

Now, if I was writing a game that needed to be shipped on everything possible and I can’t afford Unity or Unreal, SDL is a viable choice. MonoGame, mine, and others have used it, it’s battle tested.

I just can’t look at SDL code anymore and say “this is the cleanest api” for anything outside of C99.


As with most SDL usage, it merely provides a rendering context and an input abstraction.

That's almost nothing, its boilerplate you don't want to write. Which particular lib you grab that boilerplate from, SDL, GLFW, fucking GLEW, whatever, it doesn't matter. SDL is a widely accepted library for doing so and it's fine. If you want more complete input handling you'll be using the platform APIs directly.


And surfaces, and audio… yeah I know. For tinkering and learning, sure. If you’re going to build an engine, pull that boilerplate code within.


Many, arguably most, custom game engines never internalize that boilerplate. Most engine codebases are much smaller and more specialized than the AAA players, and gain nothing from splitting their build into platform-specific layers when they could just link SDL.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: