$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
app_input.h
Go to the documentation of this file.
1 
14 #ifndef APP_INPUT_H
15 #define APP_INPUT_H
16 
17 #include "gl_common.h"
18 
19 /* Forward declarations — avoids pulling heavy headers into app_input.h */
20 typedef struct App App;
21 typedef struct Camera Camera;
22 typedef struct Scene Scene;
23 typedef struct PostProcess PostProcess;
24 typedef struct EnvManager EnvManager;
25 typedef struct ActionNotifier ActionNotifier;
26 typedef struct AppUIOverlay AppUIOverlay;
27 typedef struct GPUProfilerUI GPUProfilerUI;
28 typedef struct EffectBenchmark EffectBenchmark;
29 typedef struct PerfModeContext PerfModeContext;
30 typedef struct GamepadState GamepadState;
31 typedef struct AsyncLoader AsyncLoader;
32 
41 typedef struct {
54 
55  /* Mutable scalar state (pointers so mutations propagate to App) */
56  int* width;
57  int* height;
60  int* saved_x;
61  int* saved_y;
70 
82 void key_callback(GLFWwindow* window, int key, int scancode, int action,
83  int mods);
84 
91 void mouse_callback(GLFWwindow* window, double xpos, double ypos);
92 
99 void scroll_callback(GLFWwindow* window, double xoffset, double yoffset);
100 
111 void framebuffer_size_callback(GLFWwindow* window, int width, int height);
112 
121 void handle_app_input(AppInputContext* ctx, int key, int mods);
122 
123 /* --- Internal Logic Bridge Functions --- */
124 
132 void app_handle_env_input(AppInputContext* ctx, int action, int mods, int key);
133 
140 
146 void app_save_png_frame(AppInputContext* ctx, const char* filename);
147 
156 
157 #endif /* APP_INPUT_H */
void scroll_callback(GLFWwindow *window, double xoffset, double yoffset)
Primary GLFW scroll callback.
Definition: app_input.c:883
void handle_app_input(AppInputContext *ctx, int key, int mods)
Dispatches application-level logic for key inputs.
Definition: app_input.c:648
void key_callback(GLFWwindow *window, int key, int scancode, int action, int mods)
Primary GLFW key callback.
Definition: app_input.c:758
void app_save_png_frame(AppInputContext *ctx, const char *filename)
Captures the current framebuffer and saves it as a PNG file.
Definition: app_input.c:892
void framebuffer_size_callback(GLFWwindow *window, int width, int height)
Primary GLFW framebuffer size callback.
Definition: app_input.c:39
AppInputContext app_input_ctx_from_app(App *app)
Constructs an AppInputContext from the full App state.
Definition: app.c:497
void app_handle_env_input(AppInputContext *ctx, int action, int mods, int key)
Handles input for cycling environment maps.
Definition: app_input.c:93
void app_toggle_fullscreen(AppInputContext *ctx, GLFWwindow *window)
Toggles the application window between Windowed and Fullscreen.
Definition: app_input.c:824
void mouse_callback(GLFWwindow *window, double xpos, double ypos)
Primary GLFW mouse position callback.
Definition: app_input.c:868
Common OpenGL definitions, RAII helpers, and utilities.
Manager for action notifications.
Definition: action_notifier.h:41
Focused context for application-level input handling.
Definition: app_input.h:41
int * pending_height
Definition: app_input.h:66
AsyncLoader * async_loader
Definition: app_input.h:53
int * saved_x
Definition: app_input.h:60
int * pending_width
Definition: app_input.h:65
int * saved_y
Definition: app_input.h:61
int * height
Definition: app_input.h:57
ActionNotifier * notifier
Definition: app_input.h:47
int * resize_pending
Definition: app_input.h:64
int * saved_height
Definition: app_input.h:63
GamepadState * gamepad
Definition: app_input.h:52
PerfModeContext * perf_context
Definition: app_input.h:51
int * camera_enabled
Definition: app_input.h:58
GPUProfilerUI * timeline_ui
Definition: app_input.h:49
Camera * camera
Definition: app_input.h:43
EnvManager * env_mgr
Definition: app_input.h:46
Scene * scene
Definition: app_input.h:44
int * log_gpu_metrics
Definition: app_input.h:68
int * width
Definition: app_input.h:56
int * saved_width
Definition: app_input.h:62
EffectBenchmark * effect_bench
Definition: app_input.h:50
PostProcess * postprocess
Definition: app_input.h:45
int * perf_mode_active
Definition: app_input.h:67
int * is_fullscreen
Definition: app_input.h:59
AppUIOverlay * overlay
Definition: app_input.h:48
GLFWwindow * window
Definition: app_input.h:42
Definition: app_ui.h:40
The central state container for the entire application.
Definition: app.h:24
Opaque handle to the asynchronous loader context.
Definition: async_loader.c:17
Represents a 3D camera with orientation, movement, and physical properties.
Definition: camera.h:40
State for the automated benchmark sweep.
Definition: effect_benchmark.h:65
Encapsulates state for environment loading, transitions, and IBL.
Definition: env_manager.h:26
Manages the visual state and animations for the GPU timeline.
Definition: gpu_profiler_ui.h:12
Definition: gamepad_input.h:44
State container for performance mode.
Definition: perf_mode.h:52
Main pipeline state for post-processing.
Definition: postprocess_internal.h:46
Encapsulates all 3D scene data, geometry, and rendering state.
Definition: scene.h:28
struct GLFWwindow GLFWwindow
Definition: window.h:4