$darkmode
UI rendering module for the application. More...
#include "app_settings.h"#include "glad/glad.h"#include "ui.h"#include <GLFW/glfw3.h>#include <cglm/types.h>#include <stdbool.h>Go to the source code of this file.
Data Structures | |
| struct | KeyPos |
| struct | KeyboardLayoutConfig |
| struct | AppUIOverlay |
Enumerations | |
| enum | { HISTO_BUCKETS = 256 } |
| enum | { UI_LOADING_TEXT_SIZE = 64 } |
| enum | { DEBUG_TEXT_BUFFER_SIZE = 128 , RANGE_TEXT_BUFFER_SIZE = 64 , ENV_TEXT_BUFFER_SIZE = 256 , EXPOSURE_TEXT_BUFFER_SIZE = 64 , MODIFIER_BUFFER_SIZE = 16 , KEYBOARD_BUFFER_SIZE = 256 } |
| enum | { ROW_SYSTEM = 0 , ROW_NUMBERS = 1 , ROW_QWERTY = 2 , ROW_ASDF = 3 , ROW_ZXCV = 4 , ROW_BOTTOM = 5 } |
Functions | |
| void | app_draw_help_overlay (const App *app) |
| Draws the help overlay with keyboard shortcuts. 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 | DEFAULT_BASE_RESOLUTION_HEIGHT = 1080.0F |
| static const float | DEFAULT_KBD_KEY_SIZE = 60.0F |
| static const float | DEFAULT_KBD_KEY_PADDING = 10.0F |
| static const float | DEFAULT_KBD_KEY_RADIUS = 10.0F |
| static const float | DEFAULT_KBD_LABEL_SCALE = 0.75F |
| static const float | DEFAULT_KBD_TITLE_Y_OFFSET = 140.0F |
| static const float | DEFAULT_KBD_DETAIL_Y_OFFSET = 100.0F |
| static const float | LUMINANCE_EPSILON = 0.0001F |
| static const float | UI_CENTER_FACTOR = 0.5F |
| static const float | GRAPH_TEXT_PADDING = 20.0F |
| static const float | DEBUG_TEXT_Y_OFFSET = DEFAULT_FONT_SIZE * 4.0F |
| static const float | LEGEND_Y_FACTOR = 0.6F |
| static const float | LEGEND_X_START_FACTOR = 0.25F |
| static const float | LEGEND_STEP_FACTOR = 0.18F |
| static const float | LEGEND_COMBO_STEP_MULT = 1.9F |
| static const float | GRAPH_POS_X = 20.0F |
| static const float | GRAPH_POS_Y_OFF = 200.0F |
| static const float | GRAPH_DIM_W = 300.0F |
| static const float | GRAPH_DIM_H = 100.0F |
| static const float | DEFAULT_KBD_BLOOM_SCALE = 1.3F |
| static const float | DEFAULT_KBD_UNBOUND_ALPHA = 0.22F |
| static const float | DEFAULT_KBD_BOUND_ALPHA = 0.88F |
| static const float | PANEL_FRAME_ALPHA = 0.72F |
| static const float | BLOOM_MAX_INTENSITY = 0.5F |
| static const float | GLOW_HOVER_ALPHA = 0.6F |
| static const float | BLOOM_PRESS_MAX_ALPHA = 0.9F |
| static const float | HELP_BG_ALPHA = 0.88F |
| static const float | KEY_PRESSED_ALPHA = 0.95F |
| static const float | KEY_DEFAULT_ALPHA = 0.4F |
| static const float | KEY_PRESS_BRIGHTEN_MIN = 0.6F |
| static const float | HELP_TEXT_ALPHA = 0.8F |
| static const float | HELP_EXIT_HINT_X_OFF = 300.0F |
| static const float | HELP_EXIT_HINT_Y_OFF = 50.0F |
| static const vec3 | KEY_COLOR_DEFAULT = {0.15F, 0.15F, 0.20F} |
| static const vec3 | KEY_COLOR_TOGGLE = {0.0F, 0.82F, 0.92F} |
| static const vec3 | KEY_COLOR_CYCLE = {0.12F, 0.90F, 0.12F} |
| static const vec3 | KEY_COLOR_COMBINATION = {1.0F, 0.56F, 0.05F} |
| static const vec3 | HELP_BG_COLOR = {0.05F, 0.05F, 0.07F} |
| static const vec3 | CYBER_TITLE_COLOR = {0.0F, 0.90F, 0.95F} |
| static const vec3 | ENV_TEXT_COLOR = {0.7F, 0.7F, 0.7F} |
| static const vec3 | GRAPH_TEXT_COLOR = {0.8F, 0.8F, 0.8F} |
| static const vec3 | DEBUG_ORANGE_COLOR = {1.0F, 0.5F, 0.0F} |
| static const vec3 | HISTO_BAR_COLOR_GREEN = {0.0F, 0.7F, 0.0F} |
| static const vec3 | HISTO_BAR_COLOR_BLUE = {0.0F, 0.5F, 0.8F} |
| static const vec3 | HISTO_BAR_COLOR_RED = {0.8F, 0.5F, 0.0F} |
| static const float | GLOBAL_DIM_MAX_FALLOFF = 0.7F |
| static const float | GLOBAL_DIM_SMOOTH_FACTOR = 15.0F |
| static const double | HOVER_DECAY_DURATION = 0.15 |
| static const float | HELP_PRESS_DURATION = 2.0F |
| static const double | UI_SPINNER_SPEED = 10.0 |
| static const float | UI_LOADING_TEXT_WIDTH_FACTOR = 20.0F |
| static const float | UI_SPINNER_SIZE = 64.0F |
| static const float | UI_TEXT_OFFSET_FACTOR = 0.8F |
| static const vec3 | UI_SPINNER_COLOR |
| static const KeyPos | KEY_LAYOUT_QWERTY [] |
UI rendering module for the application.
This module handles all UI-related drawing operations, including help overlays, debug information, and luminance statistics.
| anonymous enum |
| void app_draw_debug_overlay | ( | const App * | app | ) |
Draws the debug overlay with performance metrics and settings.
| app | Pointer to the application state. |
| void app_draw_help_overlay | ( | const App * | app | ) |
Draws the help overlay with keyboard shortcuts.
| app | Pointer to the application state. |
| void app_render_ui | ( | const App * | app | ) |
Main UI rendering entry point.
Orchestrates all UI elements (overlays, histograms, loading spinners).
| app | Pointer to the application state. |
| void app_ui_cleanup | ( | AppUIOverlay * | overlay | ) |
| void app_ui_handle_mouse | ( | AppUIOverlay * | overlay, |
| double | xpos, | ||
| double | ypos, | ||
| int | width, | ||
| int | height | ||
| ) |
| void app_ui_init | ( | AppUIOverlay * | overlay | ) |
| void app_ui_update | ( | AppUIOverlay * | overlay, |
| double | delta_time | ||
| ) |
| 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.
| app | Pointer to the application state. | |
| buckets | Array to fill with histogram data. | |
| size | Number of buckets in the array. | |
| [out] | min_lum | Minimum luminance found in the data. |
| [out] | max_lum | Maximum luminance found in the data. |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |