#pragma once

#include <GL/glew.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <GLFW/glfw3.h>
#include "math.h"

struct Camera {
  Vector3 position = Vector3(0.0f, 0.0f, 0.0f);
  Vector3 front = Vector3(0.0f, 0.0f, -1.0f);
  Vector3 up = Vector3(0.0f, 0.0f, 0.0f);
  Vector3 right = Vector3(0.0f, 0.0f, 0.0f);
  Vector3 world_up = Vector3(0.0f, 1.0f, 0.0f);

  f32 yaw = 90.0f;
  f32 pitch = 0.0f;
  f32 movement_speed = 5.0f;
  f32 rotation_speed = 1.0f;
};

void update_camera(Camera *camera);
void key_control(Camera *camera, bool *ascii_keys, f32 dt);
void mouse_control(Camera *camera, f32 x_change, f32 y_change);
Matrix4 calculate_view_matrix(Camera *camera);
