#pragma once

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

struct Window {
  u32 width = 800, height = 600;
  s32 buffer_width, buffer_height;
  GLFWwindow *gl_window = nullptr;
  bool ascii_keys[1024];

  // Camera coords
  f32 last_x_position;
  f32 last_y_position;
  f32 x_change_position;
  f32 y_change_position;
  bool first_mouse_movement;

  Window(u32 window_width, u32 window_height);
  ~Window();
};

bool setup_window(Window *window);
void handle_keys(GLFWwindow *gl_window, int key, int code, int action, int mode);
void handle_mouse(GLFWwindow *gl_window, f64 x_position, f64 y_position);
