$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
camera_input.c File Reference
#include "camera_input.h"
#include "camera.h"
#include <GLFW/glfw3.h>
Include dependency graph for camera_input.c:

Functions

void camera_input_handle_key (Camera *cam, int key, int action)
 Processes a keyboard event to update camera movement flags. More...
 
void camera_input_handle_mouse (Camera *cam, double xpos, double ypos)
 Processes a mouse movement event to update camera orientation. More...
 
void camera_input_handle_scroll (Camera *cam, double yoffset)
 Processes a scroll event to adjust camera speed or zoom. More...
 

Function Documentation

◆ camera_input_handle_key()

void camera_input_handle_key ( Camera cam,
int  key,
int  action 
)

Processes a keyboard event to update camera movement flags.

Maps specific keys (W, A, S, D, Q, E) to camera movement directions.

Parameters
camPointer to the Camera instance.
keyThe key code (e.g., GLFW_KEY_W).
actionThe key action (e.g., GLFW_PRESS, GLFW_RELEASE).

◆ camera_input_handle_mouse()

void camera_input_handle_mouse ( Camera cam,
double  xpos,
double  ypos 
)

Processes a mouse movement event to update camera orientation.

Calculates the delta from the last known position stored in the Camera struct and applies rotation (yaw/pitch).

Parameters
camPointer to the Camera instance.
xposThe current absolute X coordinate of the mouse.
yposThe current absolute Y coordinate of the mouse.
Here is the call graph for this function:

◆ camera_input_handle_scroll()

void camera_input_handle_scroll ( Camera cam,
double  yoffset 
)

Processes a scroll event to adjust camera speed or zoom.

Parameters
camPointer to the Camera instance.
yoffsetThe vertical scroll amount.
Here is the call graph for this function: