News for hackers. Stuff that matters.
Re:Let's compile like it's 1992 (2014) by krapp on Monday February 26, 2024 @08:20PM (#39518891)
SDL is a cross platform library, so it works by just using whatever native rendering context is available, abstracted to a common API. In more general terms AFAIK it uses the geometry API under the hood and just pushes triangles/quads to the GPU whenever possible.
Re:Let's compile like it's 1992 (2014) by hnthrowaway0328 on Monday February 26, 2024 @09:35PM (#39519468)
Thanks a lot. Is it the same for 2d?
Re:Let's compile like it's 1992 (2014) by krapp on Tuesday February 27, 2024 @05:18AM (#39522363)
I was refering to 2D. for 3D, SDL2 has OpenGL and Vulkan APIs.

SDL3 is going to have a general purpose 3D API with its own shader language AFAIK.

In my experience, if what you want is to just get a window open and render some sprites, have some basic low level stuff handled and not have your hand held, SDL2 is ridiculously easy for it. There's also Raylib[0] and SFML[1], neither of which I've used but I hear good things about.

[0]https://www.raylib.com/

[1]https://www.sfml-dev.org/

Re:Let's compile like it's 1992 (2014) by hnthrowaway0328 on Tuesday February 27, 2024 @06:54PM (#39531923)
Thanks, I'm not familiar with the graphics internals so sorry for the confusion.

Yeah I made half of a Ultima spinoff with SDL2 and it's pretty easy. Basically I load a texture which is a spritesheet and it's trivial to present a tilemap.