News for hackers. Stuff that matters.
Re:SDL2 common mistakes and how to avoid them by skywal_l on Sunday January 08, 2023 @03:32AM (#34297213)
> SDL may rename the application’s main to SDL_main and substitute its own C main

Wow ok. This FAQ[0] is for windows but I guess the same applied for linux.

> A software renderer fallback is exactly the behavior you want!

Apart from the fact that I don't see this situation happening in the context of gaming, if it were to happen, I am not sure that this behavior is always desirable. If your game has a sufficiently complex render loop, a software renderer might be too slow and will generate support calls. You might want to be upfront with the user and fail with a meaningful error message especially if you claim the need of a GPU on your system as a minimal requirement. The user might have a GPU but badly configured on their system for example.

So the gist of this article is that SDL is a framework and if you commit to a framework you might has well commit fully. SDL having an API that goes beyond graphics, you might find the API you need for a particular purpose and not use the system one to keep you software as portable as possible.

The thing is, I see SDL as a way to get a graphical window as cheaply as possible. I don't necessarily see it as a framework. I actually have a deep, and probably irrational, mistrust of frameworks.

[0] https://wiki.libsdl.org/SDL2/FAQWindows#i_get_undefined_refe......

Edit: added a conclusion

Re:SDL2 common mistakes and how to avoid them by TheChaplain on Sunday January 08, 2023 @05:43AM (#34297930)
I think you've misunderstood SDL a bit. It's just a very low-level framework to get access to the canvas, events, inputs, sound etc., on multiple platforms. The hardware acceleration is for simple blits and texture painting which is fine for most 2d games.

If you want anything more than the very basics, there's always Godot or Unity.

Re:SDL2 common mistakes and how to avoid them by krapp on Sunday January 08, 2023 @07:23PM (#34305051)
FWIW, SDL has a geometry API now too. It's basic (and only good for 2D) but you can push triangles and textured quads without OpenGL.
Re:SDL2 common mistakes and how to avoid them by Keyframe on Sunday January 08, 2023 @04:41PM (#34303437)
Set up windowing (to get to your OpenGL/Vulkan/DX/whatever), input (is it low latency), maybe timers and maybeeee audio. .so loading and function lookup is useful, but is anyone actually using SDL threads and networking?
Re:SDL2 common mistakes and how to avoid them by reassembled on Sunday January 08, 2023 @05:59PM (#34304289)
My friend used SDL_Thread and SDL_Net in his game. They’re just platform threading and socket abstractions, respectively.

https://deftware.itch.io/bitphoria