-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDL3 + GPU backend #13
Comments
On how disruptive it may be to upgrade ImGUI to a newer versions, some backend initialization parameters have changed. These are trivial to fix but worth mentioning. With the way backends are exposed in zgui, I think the intent was to have freedom to not be constrained to a single unified interface various ImGUI calls for rendering, which in hindsight works well here as there's an exception with SDL3 ( On the topic of disruption, as long as there's no breaking changes for ImGUI that prevents the other libraries from building, I think upgrading only ImGUI is fine. If there are functional changes in ImGUI that affect the libraries that consume it and produce bugs, then upgrading them to latest version (if any) on request is the only sane solution without having to eye for breaking changes across all of the libraries. The other libraries are not as actively maintained as ImGUI, so releases are sparse. Usually we can assume they keep working with new released versions of ImGUI, until they suddenly don't. Largely, ImGUI does a good job to not break backwards compatibility. I think there's two alternatives here:
|
SDL3 was recently officially released (see the 3.2.0 release) along with a nice new GPU API. It would be nice to add the ImGui SDL3+GPU backend to zgui.
Prototype
I have a working prototype in my fork here and here's an example that makes use of it. I learned a few things along the way:
libs/imgui
to version v1.91.8 since it's the first ImGui release since SDL3 came out and also because the backend for SDL3+GPU API didn't existed in v.1.91.0.draw
function. For the SDL3+GPU backend, I had to break it into three functions,render
(to invokeImGui::Render
),prepareDrawData
andrenderDrawData
. This is because at leastprepareDrawData
andrenderDrawData
must be called at different point when rendering with the GPU API (more details in the backend header file here).render
andprepareDrawData
could be combined into one call. A possibly better API for this backend could beprepareDraw
anddraw
function.Questions
The text was updated successfully, but these errors were encountered: