$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
app.h
Go to the documentation of this file.
1 #ifndef APP_H
2 #define APP_H
3 
4 #include "action_notifier.h"
5 #include "app_ui.h"
6 #include "app_window.h"
7 #include "effect_benchmark.h"
8 #include "gl_common.h"
9 #include <cglm/cglm.h>
10 
11 /* --- Opaque sub-struct forward declarations --- */
12 typedef struct AppProfiling AppProfiling;
13 typedef struct AppInput AppInput;
14 typedef struct PostProcess PostProcess;
15 typedef struct Scene Scene;
16 typedef struct EnvManager EnvManager;
17 typedef struct AsyncLoader AsyncLoader;
18 typedef struct AsyncCoordinator AsyncCoordinator;
19 
24 typedef struct App {
25  /* --- Pointers and Dynamic Objects --- */
29  double last_frame_time;
30  double delta_time;
31  uint64_t frame_count;
34  /* --- Sub-Modules (Opaque, Heap-Allocated) --- */
39  /* --- App State Flags and Values --- */
40  int width;
41  int height;
46  /* --- Global GPU Resources --- */
47  GLuint lum_ssbo[2];
49  /* --- Global Configuration Uniforms --- */
50  float u_metallic;
51  float u_roughness;
52  float u_ao;
53  float u_exposure;
59 } App;
60 
61 /* --- Core Control Flow --- */
62 
66 int app_init(App* app, int width, int height, const char* title);
67 
71 void app_cleanup(App* app);
72 
76 void app_run(App* app);
77 
81 void app_update(App* app);
82 
84 
85 #endif /* APP_H */
Temporary on-screen notification system for user actions.
@ TRACY_SCREENSHOT_WIDTH
Definition: app.h:83
@ TRACY_SCREENSHOT_HEIGHT
Definition: app.h:83
void app_run(App *app)
Enters the main application rendering and event loop.
Definition: app.c:236
void app_cleanup(App *app)
Safely releases all GPU and CPU resources held by the application.
Definition: app.c:185
int app_init(App *app, int width, int height, const char *title)
Fully initializes the application state, window, and OpenGL context.
Definition: app.c:41
struct AsyncCoordinator AsyncCoordinator
Definition: app.h:18
void app_update(App *app)
One-frame logic update (physics, timers, camera).
Definition: app.c:461
UI rendering module for the application.
Automated A/B GPU cost measurement for individual postprocess effects.
Common OpenGL definitions, RAII helpers, and utilities.
Manager for action notifications.
Definition: action_notifier.h:41
Camera, gamepad, key-bindings, and input smoothing grouped together.
Definition: app_input_state.h:22
Profiling, metrics, and performance monitoring grouped together.
Definition: app_profiling.h:24
Definition: app_ui.h:40
Groups GLFW window handle and all window/resize state.
Definition: app_window.h:14
The central state container for the entire application.
Definition: app.h:24
float u_roughness
Definition: app.h:51
AppUIOverlay overlay
Definition: app.h:37
int width
Definition: app.h:40
double last_frame_time
Definition: app.h:29
GLuint lum_ssbo[2]
Definition: app.h:47
EffectBenchmark effect_bench
Definition: app.h:44
int height
Definition: app.h:41
PostProcess * postprocess
Definition: app.h:27
float u_metallic
Definition: app.h:50
Scene * scene
Definition: app.h:26
AppProfiling * profiling
Definition: app.h:35
float u_ao
Definition: app.h:52
float * lum_histogram_buffer
Definition: app.h:32
double delta_time
Definition: app.h:30
AppWindow win
Definition: app.h:28
uint64_t frame_count
Definition: app.h:31
float u_exposure
Definition: app.h:53
EnvManager * env_mgr
Definition: app.h:42
AppInput * input
Definition: app.h:36
AsyncLoader * async_loader
Definition: app.h:55
ActionNotifier notifier
Definition: app.h:43
AsyncCoordinator * async_coord
Definition: app.h:57
Opaque handle to the asynchronous loader context.
Definition: async_loader.c:17
State for the automated benchmark sweep.
Definition: effect_benchmark.h:65
Encapsulates state for environment loading, transitions, and IBL.
Definition: env_manager.h:26
Main pipeline state for post-processing.
Definition: postprocess_internal.h:46
Encapsulates all 3D scene data, geometry, and rendering state.
Definition: scene.h:28