$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
app_ui.h File Reference

UI rendering module for the application. More...

#include "glad/glad.h"
#include "ui.h"
Include dependency graph for app_ui.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  KeyboardLayoutConfig
 
struct  AppUIOverlay
 

Enumerations

enum  { HISTO_BUCKETS = 256 }
 
enum  HelpMode { HELP_MODE_OFF = 0 , HELP_MODE_KEYBOARD , HELP_MODE_GAMEPAD , HELP_MODE_COUNT }
 States for the F2 help overlay cycling. More...
 

Functions

void app_draw_help_overlay (const App *app)
 Draws the help overlay with keyboard shortcuts. More...
 
void app_draw_gamepad_help_overlay (const App *app)
 Draws the gamepad help overlay with controller bindings. More...
 
void app_draw_debug_overlay (const App *app)
 Draws the debug overlay with performance metrics and settings. More...
 
void app_render_ui (const App *app)
 Main UI rendering entry point. More...
 
int compute_luminance_histogram (const App *app, int *buckets, int size, float *min_lum, float *max_lum)
 Computes the luminance histogram from current frame data. More...
 
void app_ui_init (AppUIOverlay *overlay)
 
void app_ui_cleanup (AppUIOverlay *overlay)
 
void app_ui_update (AppUIOverlay *overlay, double delta_time)
 
void app_ui_handle_mouse (AppUIOverlay *overlay, double xpos, double ypos, int width, int height)
 

Variables

static const float HELP_PRESS_DURATION = 2.0F
 

Detailed Description

UI rendering module for the application.

This module handles all UI-related drawing operations, including help overlays, debug information, and luminance statistics.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
HISTO_BUCKETS 

◆ HelpMode

enum HelpMode

States for the F2 help overlay cycling.

Enumerator
HELP_MODE_OFF 
HELP_MODE_KEYBOARD 
HELP_MODE_GAMEPAD 
HELP_MODE_COUNT 

Function Documentation

◆ app_draw_debug_overlay()

void app_draw_debug_overlay ( const App *  app)

Draws the debug overlay with performance metrics and settings.

Parameters
appPointer to the application state.
Here is the call graph for this function:

◆ app_draw_gamepad_help_overlay()

void app_draw_gamepad_help_overlay ( const App *  app)

Draws the gamepad help overlay with controller bindings.

Parameters
appPointer to the application state.
Here is the call graph for this function:

◆ app_draw_help_overlay()

void app_draw_help_overlay ( const App *  app)

Draws the help overlay with keyboard shortcuts.

Parameters
appPointer to the application state.
Here is the call graph for this function:

◆ app_render_ui()

void app_render_ui ( const App *  app)

Main UI rendering entry point.

Orchestrates all UI elements (overlays, histograms, loading spinners).

Parameters
appPointer to the application state.
Here is the call graph for this function:

◆ app_ui_cleanup()

void app_ui_cleanup ( AppUIOverlay *  overlay)
Here is the call graph for this function:

◆ app_ui_handle_mouse()

void app_ui_handle_mouse ( AppUIOverlay *  overlay,
double  xpos,
double  ypos,
int  width,
int  height 
)

◆ app_ui_init()

void app_ui_init ( AppUIOverlay *  overlay)
Here is the call graph for this function:

◆ app_ui_update()

void app_ui_update ( AppUIOverlay *  overlay,
double  delta_time 
)

◆ compute_luminance_histogram()

int compute_luminance_histogram ( const App *  app,
int *  buckets,
int  size,
float *  min_lum,
float *  max_lum 
)

Computes the luminance histogram from current frame data.

Scans the luminance buffer to populate buckets for visualization.

Parameters
appPointer to the application state.
bucketsArray to fill with histogram data.
sizeNumber of buckets in the array.
[out]min_lumMinimum luminance found in the data.
[out]max_lumMaximum luminance found in the data.
Returns
Number of samples processed or error code.
Here is the call graph for this function:

Variable Documentation

◆ HELP_PRESS_DURATION

const float HELP_PRESS_DURATION = 2.0F
static