group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
DebugUI Class Reference

Forward-declared to avoid pulling in heavy particle headers. More...

#include <DebugUI.hpp>

Public Member Functions

bool init (SDL_Window *window)
 Create the ImGui context and initialise the SDL3 input backend.
 
void shutdown ()
 Destroy the ImGui context and shut down the SDL3 input backend.
 
void processEvent (const SDL_Event *event)
 Forward an SDL event to the ImGui input backend.
 
void newFrame ()
 Begin a new ImGui frame. Call before any ImGui draw calls.
 
void buildUI (const Registry &registry, int tickCount, float &mouseSensitivity, bool &renderSeparateFromPhysics, bool &inputSyncedWithPhysics, bool &limitFPSToMonitor, int &ssrMode, float physicsHz, float fpsCurrent, float fpsMin, float fpsMax, float fps1pLow, float fps5pLow)
 Build the ECS inspector window contents.
 
void buildParticleUI (ParticleSystem &ps, glm::vec3 eyePos, glm::vec3 forward)
 Build the Particle System debug/control window.
 
void buildRenderTogglesUI (struct RenderToggles &toggles)
 Build the Render Toggles window for live performance profiling.
 
void buildSkyboxUI (class Renderer &renderer)
 Build the Skybox selector window for live HDR skybox swapping.
 
void buildLightingUI (class Renderer &renderer)
 Build the Lighting Controls window for live parameter tuning.
 
void render ()
 Finalise the ImGui frame. Call after all ImGui draw calls, before Renderer::drawFrame().
 

Detailed Description

Forward-declared to avoid pulling in heavy particle headers.

Live ECS inspector overlay powered by Dear ImGui.

Ownership split:

  • DebugUI — ImGui context, imgui_impl_sdl3 input backend, UI state
  • Rendererimgui_impl_sdlgpu3 render backend (owns the GPU device)

Initialisation order in Game::init():

  1. debugUI.init(window) — context must exist before GPU backend init
  2. renderer.init(window) — GPU backend init happens here

Shutdown order in Game::quit():

  1. renderer.quit() — GPU backend shutdown first
  2. debugUI.shutdown() — context destroyed last

Member Function Documentation

◆ buildLightingUI()

void DebugUI::buildLightingUI ( class Renderer renderer)

Build the Lighting Controls window for live parameter tuning.

Here is the caller graph for this function:

◆ buildParticleUI()

void DebugUI::buildParticleUI ( ParticleSystem ps,
glm::vec3  eyePos,
glm::vec3  forward 
)

Build the Particle System debug/control window.

Parameters
psThe particle system to inspect and control.
eyePosCamera eye position (used to compute spawn position).
forwardCamera forward unit vector.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildRenderTogglesUI()

void DebugUI::buildRenderTogglesUI ( struct RenderToggles toggles)

Build the Render Toggles window for live performance profiling.

Parameters
togglesThe renderer's toggle struct (read/write).
Here is the caller graph for this function:

◆ buildSkyboxUI()

void DebugUI::buildSkyboxUI ( class Renderer renderer)

Build the Skybox selector window for live HDR skybox swapping.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildUI()

void DebugUI::buildUI ( const Registry registry,
int  tickCount,
float &  mouseSensitivity,
bool &  renderSeparateFromPhysics,
bool &  inputSyncedWithPhysics,
bool &  limitFPSToMonitor,
int &  ssrMode,
float  physicsHz,
float  fpsCurrent,
float  fpsMin,
float  fpsMax,
float  fps1pLow,
float  fps5pLow 
)

Build the ECS inspector window contents.

Parameters
registryThe ECS registry to inspect.
tickCountTotal physics ticks elapsed.
mouseSensitivityRadians per pixel; slider (read/write).
renderSeparateFromPhysicsInterpolated unlimited-fps mode toggle (read/write).
inputSyncedWithPhysicsSample input once per tick vs every frame (read/write).
limitFPSToMonitorVSync on/off toggle (read/write).
physicsHzMeasured physics tick rate (Hz).
fpsCurrentMost-recent render FPS sample.
fpsMinMinimum FPS in the rolling window.
fpsMaxMaximum FPS in the rolling window.
fps1pLow1st-percentile FPS (1 % low).
fps5pLow5th-percentile FPS (5 % low).
Here is the caller graph for this function:

◆ init()

bool DebugUI::init ( SDL_Window *  window)

Create the ImGui context and initialise the SDL3 input backend.

Parameters
windowThe SDL window receiving input events.
Returns
False if ImGui backend initialisation fails.
Here is the caller graph for this function:

◆ newFrame()

void DebugUI::newFrame ( )

Begin a new ImGui frame. Call before any ImGui draw calls.

Here is the caller graph for this function:

◆ processEvent()

void DebugUI::processEvent ( const SDL_Event *  event)

Forward an SDL event to the ImGui input backend.

Parameters
eventThe event to process.
Here is the caller graph for this function:

◆ render()

void DebugUI::render ( )

Finalise the ImGui frame. Call after all ImGui draw calls, before Renderer::drawFrame().

Here is the caller graph for this function:

◆ shutdown()

void DebugUI::shutdown ( )

Destroy the ImGui context and shut down the SDL3 input backend.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: