Skip to content

ImGui: r_imgui cvar, skip frames when off, F11 toggle#175

Merged
cursor[bot] merged 1 commit intomainfrom
cursor/imgui-r-imgui-toggle-0a71
May 4, 2026
Merged

ImGui: r_imgui cvar, skip frames when off, F11 toggle#175
cursor[bot] merged 1 commit intomainfrom
cursor/imgui-r-imgui-toggle-0a71

Conversation

@timfox
Copy link
Copy Markdown
Owner

@timfox timfox commented May 4, 2026

Summary

Adds a runtime toggle for the Vulkan ImGui debug inspector without requiring vid_restart.

Changes

  • r_imgui (default 1): when 0, the renderer skips VkImgui_BeginFrame / VkImgui_Draw CPU work for that frame. Renderer init logs [VK][imgui] debug inspector r_imgui=... (F11 toggles when enabled).
  • Client: toggle_imgui command toggles r_imgui; F11 runs toggle_imgui on first key repeat only (after console handling), only when not dedicated server. CMake defines USE_IMGUI on the client target when USE_IMGUI is ON so the key/command compile only in ImGui builds.

Validation

  • ./scripts/compile_engine.sh vulkan
  • ctest from build dir (all tests passed)

Notes

F11 is hardcoded like K_PRINT/K_CONSOLE; bind another key with bind x toggle_imgui if F11 conflicts with existing binds.

Open in Web Open in Cursor 

Introduce renderer cvar r_imgui (default on) with startup log; gate
VkImgui BeginFrame/Draw when disabled to reduce CPU when the inspector
is off. Client defines USE_IMGUI when USE_IMGUI CMake option is on;
add toggle_imgui command and hardcoded F11 for Vulkan+ImGui builds.

Co-authored-by: Tim Fox <timfox@outlook.com>
@cursor cursor Bot merged commit 878a865 into main May 4, 2026
44 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants