#pragma once

#include "basic.h"
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include "render_data.h"
#include "user_interface.h"
#include "camera.h"
#include "timer.h"
#include "frame_buffer.h"
#include "vertex_buffer.h"
#include "uniform_buffer.h"
#include "texture.h"
#include "shaders.h"


struct Renderer {
  Shader shader;
  Shader alt_shader;
  Frame_Buffer frame_buffer;
  Vertex_Buffer vertex_buffer;
  Uniform_Buffer uniform_buffer;
  Texture texture;
  Mesh mesh;
  Matrix4 view_matrix = Matrix4(1.0f);
  Matrix4 projection_matrix = Matrix4(1.0f);
  User_Interface user_interface;
  Render_Data render_data;
  Timer timer;
};


bool init_renderer(Renderer *renderer, u32 width, u32 height);
void set_renderer_size(Renderer *renderer, u32 width, u32 height);
void draw_renderer(Renderer *renderer);
void upload_renderer_data(Renderer *renderer, Mesh *vertex_data);
void cleanup_renderer(Renderer *renderer);

