feat: establish stable OpenGL 3.3 core graphics conxtext

initializes the full graphics context pipeline required for modern OpenGL rendering
This commit is contained in:
Natsirt867
2025-10-17 12:40:25 -05:00
parent c9c5fc428f
commit 65e7d1b401
8 changed files with 353 additions and 44 deletions

View File

@@ -15,11 +15,26 @@ typedef struct {
vec3 Up;
float speed;
float sensitivity;
float FOV_deg;
int width;
int height;
mat4 View; // cache for the calculated View Matrix
} Camera;
void matrix(float FOVdeg, float nearPlane, float farPlane, Shader* shader_instance, const char* uniform);
void inputs(SDL_Window* window);
// initializer
void camera_init(Camera *self, vec3 initial_position, int width, int height);
/* --- Matrix calculation functions --- */
// Updates self->View matrix based on pos, orientation and up
void camera_update_view_matrix(Camera *self);
// calculates the projection matrix for a given set of planes
void camera_update_projection(Camera *self, float nearPlane, float forPlane, mat4 dest);
// generates (projection * view) and uploads to the shader program
void camera_matrix_to_shader(Camera *self, GLuint shader_program_ID, const char *uniform_name);
// TODO: Input handling (needs full SDL context later)
void camera_inputs(Camera *self, SDL_Event *event);
#endif //CAMERA_H