$darkmode
User input orchestration and application state toggles. More...
#include "gl_common.h"Go to the source code of this file.
Functions | |
| void | key_callback (GLFWwindow *window, int key, int scancode, int action, int mods) |
| Primary GLFW key callback. More... | |
| void | mouse_callback (GLFWwindow *window, double xpos, double ypos) |
| Primary GLFW mouse position callback. More... | |
| void | scroll_callback (GLFWwindow *window, double xoffset, double yoffset) |
| Primary GLFW scroll callback. More... | |
| void | framebuffer_size_callback (GLFWwindow *window, int width, int height) |
| Primary GLFW framebuffer size callback. More... | |
| void | handle_app_input (App *app, int key, int mods) |
| Dispatches application-level logic for key inputs. More... | |
| void | app_handle_env_input (App *app, int action, int mods, int key) |
| Handles input for cycling environment maps. More... | |
| void | app_toggle_fullscreen (App *app, GLFWwindow *window) |
| Toggles the application window between Windowed and Fullscreen. More... | |
| void | app_save_png_frame (App *app, const char *filename) |
| Captures the current framebuffer and saves it as a PNG file. More... | |
User input orchestration and application state toggles.
This module manages all high-level input logic, bridging GLFW raw events to application-specific actions like post-processing toggles, environment map switching, and camera movement.
| void app_handle_env_input | ( | App * | app, |
| int | action, | ||
| int | mods, | ||
| int | key | ||
| ) |
Handles input for cycling environment maps.
| app | Pointer to the application state. |
| action | GLFW action (Press/Release). |
| mods | Modifiers. |
| key | Directional key. |
| void app_save_png_frame | ( | App * | app, |
| const char * | filename | ||
| ) |
Captures the current framebuffer and saves it as a PNG file.
| app | Pointer to the application state. |
| filename | Output file path (should end in .png). |
| void app_toggle_fullscreen | ( | App * | app, |
| GLFWwindow * | window | ||
| ) |
Toggles the application window between Windowed and Fullscreen.
| app | Pointer to the application state. |
| window | GLFW window handle. |
| void framebuffer_size_callback | ( | GLFWwindow * | window, |
| int | width, | ||
| int | height | ||
| ) |
Primary GLFW framebuffer size callback.
Handles resizing of the OpenGL viewport and all dependent post-processing buffers to match the new window dimensions.
| window | The GLFW window context. |
| width | New framebuffer width. |
| height | New framebuffer height. |
postprocess_resize. | void handle_app_input | ( | App * | app, |
| int | key, | ||
| int | mods | ||
| ) |
Dispatches application-level logic for key inputs.
Handles system-wide shortcuts (ESC to exit, Space to pause, etc.).
| app | Pointer to the application state. |
| key | Locked key code. |
| mods | Active modifiers. |
| void key_callback | ( | GLFWwindow * | window, |
| int | key, | ||
| int | scancode, | ||
| int | action, | ||
| int | mods | ||
| ) |
Primary GLFW key callback.
Dispatches raw key events to handle_app_input, camera_process_key_callback, and other specific handlers.
| window | The GLFW window context. |
| key | The keyboard key code. |
| scancode | System-specific scancode. |
| action | GLFW_PRESS, GLFW_RELEASE, or GLFW_REPEAT. |
| mods | Active modifier keys (Shift, Ctrl, Alt). |
| void mouse_callback | ( | GLFWwindow * | window, |
| double | xpos, | ||
| double | ypos | ||
| ) |
Primary GLFW mouse position callback.
| window | The GLFW window context. |
| xpos | Absolute mouse X-coordinate. |
| ypos | Absolute mouse Y-coordinate. |
| void scroll_callback | ( | GLFWwindow * | window, |
| double | xoffset, | ||
| double | yoffset | ||
| ) |
Primary GLFW scroll callback.
| window | The GLFW window context. |
| xoffset | Scroll amount along the X-axis. |
| yoffset | Scroll amount along the Y-axis. |