4 ms·
When I was beggining to learn game programming, I tried really hard to like SDL, but I just couldn't. The official documentation [1] is just an API reference.
by young_unixer 5y ago
When I was beggining to learn game programming, I tried really hard to like SDL, but I just couldn't.
The official documentation [1] is just an API reference. There's no official tutorial or getting started guide that gives enough context to a beginner. There's just a bunch of links to (mostly outdated) third-party tutorials and books and some articles talking about specific parts of the library, but nothing official that serves as a foundation to a begginer.
The SDL_* subprojects ... I'm not sure if they're official SDL subprojects, third party projects that share the name, or something in between. The homepages (e.g. [2]) of these subprojects are totally different from the main project's, and their documentation is also just a listing of every function, without a general context.
Maybe for someone who already is a professional game developer, SDL is just perfect, but for a begginer (like me at the time), it's just obtuse.
[1] https://wiki.libsdl.org/FrontPage https://wiki.libsdl.org/FrontPage
[2] https://www.libsdl.org/projects/SDL_mixer/ https://www.libsdl.org/projects/SDL_mixer/
- adjlaksj9 5y agoI've also tried to learn SDL and had trouble in the past. Recently however I've been working with openbsd and it also doesnt really have a tutorial but i've found myslef productive by virtue of good docs that I know are there, and I think SDL has the same type of thing, where it takes a bit more effort to understand that a tutorial can feed you but once you understand it and how to read its documentation you can really get very proficient with how it and it sub-libraries work.
- pengaru 5y agoI used to lurk in #SDL and help beginners, the common misconception is that SDL encompasses a much larger scope of game engines than just providing an abstraction of platform-specific details. It's not SDL's fault beginners have poorly defined/uninformed expectations. But you're right about the documentation being kind of a mess. The SDL1.2 vs SDL2 differences can be annoying and for a beginner just figuring out what version the example/tutorial code they're looking at relates to can be challenging.
- TotempaaltJ 5y ago> It's not SDL's fault beginners have poorly defined/uninformed expectations. It might not be their fault but I'd still say they're probably in the best position to correct it.
- pengaru 5y agoI'm not sure what SDL can do to prevent this. From what I saw the primary cause was beginner game programming tutorials on the web, outside the SDL project, created by volunteers, judging by the code quality, often beginners themselves. The lazyfoo ones were especially popular back when I was involved. These tutorials would go immediately to creating a main.c with an SDL dependency, before even discussing game engine architecture or frankly anything at all. So you have a total noob who likely doesn't know anything about C let alone game development, being faced with their first C listing and it's immediately mentioning SDL junk for creating a window and this stuff called an event loop. Of course the newbie is lost, most the time they can't even get it to compile. The tutorial is some random abandoned long-forgotten thing on the web, with zero support available. So where do they go? SDL of course! It's the only thing on their radar at this point, and while barely on life support, there's still something resembling a community in #SDL, more recently I think they shifted to slack or something so maybe it's improving. SDL isn't in the business of teaching to build game engines. Just because awful game programming tutorials on the web tend to start with SDL because it's the platform abstraction so you initialize it first, doesn't mean SDL should take on that role, which seems to be what you're implying they're best positioned to do. There's already insufficient resources to maintain the API docs and fix bugs as-is. If you're interested in volunteering for the job, Ryan Gordon is the man to reach out to.
- krapp 5y agoThere really isn't much to learn aside from the API. SDL isn't a game engine, or even close to one. Once you know how to open a window, poll for events (maybe even create custom events and use the event system for messaging or signals), load a texture from a file and make sprites, and maybe basic AABB collision detection with rects, you know most of what SDL is useful for. Everything else is "code the rest of the f'ing owl" territory, which is outside SDL's purview.
- hgs3 5y agoInteresting, I had the exact opposite experience. SDL + Lazy Foo's tutorials [1] gave me my start into programming. [1] https://lazyfoo.net/tutorials/SDL/ https://lazyfoo.net/tutorials/SDL/
- BoorishBears 5y agoI was about to link it . My start was graphing calculators, but once I moved to PCs LazyFoo SDL and OpenGL got me started That being said, I think what throws a lot of people off is that SDL isn't really the best tool for someone focused on just writing a game. To me it's a toolkit to make your engine cross-platform, whereas a lot of people are expecting an engine.