this post was submitted on 18 Jul 2025
85 points (97.8% liked)
Programming
21924 readers
760 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Slightly related: there's things like SDL_gui, which build directly on SDL2. But SDL is a library to interface media, kinda an abstraction. How... does that work?
I know already about immediate vs. retained mode and that toolkits like Dear ImGui are more barebones (and often used in games), while kits like Qt/Slint have a Model/View pattern, have a data handling and/or messaging system.
But above just doesn't fit.
Edit: apparently SDL handles draw calls too?
In my (admittedly limited) experience, SDL/SDL2 is more of a general-purpose library for dealing with different operating systems, not for abstracting graphics APIs. While it does include a graphics abstraction layer for doing simple 2D graphics, many people use it to have the OS set up a window, process, and whatever other housekeeping is needed, and instantiate and attach a graphics surface to that window. Then they communicate with that graphics surface directly, using the appropriate graphics API rather than SDL. I've done it with OpenGL, but my impression is that using Vulkan is very similar.
SDL_gui appears to sit on top of SDL/SDL2's 2D graphics abstraction to draw custom interactive UI elements. I presume it also grabs input through SDL and runs the whole show, just outputting a queue of events for your program to process.