$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
app_ui.h
Go to the documentation of this file.
1 
9 #ifndef APP_UI_H
10 #define APP_UI_H
11 #include "glad/glad.h"
12 #include "ui.h"
13 
14 /* Histogram bucket count (used by tests and postprocess) */
15 enum { HISTO_BUCKETS = 256 };
16 
17 /* Highlight duration for key-press animation (shared with app_input.c) */
18 static const float HELP_PRESS_DURATION = 2.0F;
19 
24 typedef enum {
30 
31 typedef struct {
32  float key_size;
33  float key_padding;
34  float key_radius;
35  float label_scale;
39 
40 typedef struct AppUIOverlay {
43 
48 
57  double help_gp_decay;
62  /* Cyberpunk keyboard overlay textures (PNG assets) */
63  GLuint
65  GLuint
72 } AppUIOverlay;
73 
74 typedef struct App App;
75 
80 void app_draw_help_overlay(const App* app);
81 
86 void app_draw_gamepad_help_overlay(const App* app);
87 
92 void app_draw_debug_overlay(const App* app);
93 
100 void app_render_ui(const App* app);
101 
102 /* --- Internal helper functions --- */
103 
115 int compute_luminance_histogram(const App* app, int* buckets, int size,
116  float* min_lum, float* max_lum);
117 
121 void app_ui_handle_mouse(AppUIOverlay* overlay, double xpos, double ypos,
122  int width, int height);
123 
124 #endif /* APP_UI_H */
static const float HELP_PRESS_DURATION
Definition: app_ui.h:18
void app_draw_debug_overlay(const App *app)
Draws the debug overlay with performance metrics and settings.
Definition: app_ui.c:1048
void app_ui_init(AppUIOverlay *overlay)
Definition: app_ui.c:58
void app_render_ui(const App *app)
Main UI rendering entry point.
Definition: app_ui.c:1267
void app_ui_handle_mouse(AppUIOverlay *overlay, double xpos, double ypos, int width, int height)
Definition: app_ui.c:136
void app_ui_update(AppUIOverlay *overlay, double delta_time)
Definition: app_ui.c:101
@ HISTO_BUCKETS
Definition: app_ui.h:15
HelpMode
States for the F2 help overlay cycling.
Definition: app_ui.h:24
@ HELP_MODE_GAMEPAD
Definition: app_ui.h:27
@ HELP_MODE_COUNT
Definition: app_ui.h:28
@ HELP_MODE_OFF
Definition: app_ui.h:25
@ HELP_MODE_KEYBOARD
Definition: app_ui.h:26
void app_ui_cleanup(AppUIOverlay *overlay)
Definition: app_ui.c:88
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.
Definition: app_ui.c:1309
void app_draw_help_overlay(const App *app)
Draws the help overlay with keyboard shortcuts.
Definition: app_ui.c:396
void app_draw_gamepad_help_overlay(const App *app)
Draws the gamepad help overlay with controller bindings.
Definition: app_ui.c:661
Definition: app_ui.h:40
int help_pressed_key
Definition: app_ui.h:50
int text_overlay_mode
Definition: app_ui.h:46
UIContext ui
Definition: app_ui.h:41
KeyboardLayoutConfig kbd_config
Definition: app_ui.h:42
GLuint kbd_tex_key_base
Definition: app_ui.h:66
int help_captured_camera
Definition: app_ui.h:71
HelpMode show_help
Definition: app_ui.h:44
int help_hovered_key
Definition: app_ui.h:49
double help_press_timer
Definition: app_ui.h:52
double help_global_dim
Definition: app_ui.h:53
double help_hover_decay
Definition: app_ui.h:54
double help_gp_decay
Definition: app_ui.h:57
GLuint kbd_tex_frame
Definition: app_ui.h:64
int show_exposure_debug
Definition: app_ui.h:47
int show_info_overlay
Definition: app_ui.h:45
int help_pressed_mods
Definition: app_ui.h:51
The central state container for the entire application.
Definition: app.h:24
AppUIOverlay overlay
Definition: app.h:37
int width
Definition: app.h:40
int height
Definition: app.h:41
double delta_time
Definition: app.h:30
Definition: app_ui.h:31
float key_padding
Definition: app_ui.h:33
float detail_y_offset
Definition: app_ui.h:37
float key_radius
Definition: app_ui.h:34
float key_size
Definition: app_ui.h:32
float title_y_offset
Definition: app_ui.h:36
float label_scale
Definition: app_ui.h:35
Persistent state for the UI system.
Definition: ui.h:51
Minimal immediate-mode User Interface (UI) library.