Skip to content

Add an SDL_Renderer backend to imgui-lwjgl3 and imgui-app - #442

Open
Enaium wants to merge 1 commit into
SpaiR:mainfrom
Enaium:feat/lwjgl3-sdl-renderer
Open

Enaium wants to merge 1 commit into
SpaiR:mainfrom
Enaium:feat/lwjgl3-sdl-renderer

Conversation

@Enaium

@Enaium Enaium commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a Java port of imgui_impl_sdlrenderer3 to imgui-lwjgl3 and exposes it through imgui-app as Backend.SDL_RENDERER / WindowSdlRenderer. The backend supports user textures, vertex offsets and draw-call clipping, and ships a runnable MainSdlRenderer smoke test.

Type of change

  • New feature (non-breaking change which adds functionality)

Notes for reviewer

  • WindowSdlRenderer sets SDL_SetRenderScale(io.DisplayFramebufferScale) before each render, mirroring upstream example_sdl3_sdlrenderer3. Without it, HiDPI content commands are clipped and mouse hit-testing is offset.
  • ImGuiBackendFlags_RendererHasTextures is not set: the binding does not expose ImTextureData, so createFontsTexture() keeps the legacy ImFontAtlas#setTexID path. Dynamic atlas updates are therefore not honored.
  • ImDrawList user callbacks are not exposed by the binding and cannot be dispatched.
  • Multi-viewport is not supported, matching the other SDL backends in this repo.
  • Verified locally: ./gradlew buildAll, checkstyle, javadoc, and runtime pixel readback on macOS Retina (1280x768 window, 2560x1536 framebuffer) for rectangle, text and WindowSdlRenderer lifecycle.

Port imgui_impl_sdlrenderer3 to the LWJGL SDL3 bindings. The backend
uses SDL_RenderGeometryRaw and supports user textures, vertex offsets
and draw-call clipping. The legacy font-atlas texture flow is kept
because the binding does not expose ImTextureData yet.

Add WindowSdlRenderer and Backend.SDL_RENDERER so imgui-app can drive
the backend, plus the MainSdlRenderer smoke test and README notes.

Co-authored-by: DeepSeek <noreply@deepseek.com>
@SpaiR SpaiR added the feat New feature or request label Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants