#pragma once

#include "camera.h"
#include "glew.h"
#include "window.h"
#include "shader.h"
#include "vao.h"
#include "vbo.h"
#include "vertexattribute.h"

typedef struct Renderer
{
	SDL_GLContext glContext;
	Window* window;
	Camera camera;
	VBO vbo;	// Vertex Buffer Object
	VBO ebo;	// Element Buffer Object
	VAO vao;	// Vertex Array Object
	vec2 size;
} Renderer;

void renderer_init(Renderer* self, Window* window, CameraType type, const vec2 size);
void renderer_clear_color_set(Renderer* self, vec4 color);
void renderer_clear(Renderer* self);
void renderer_shader_use(Renderer* self, Shader* shader);
void renderer_free(Renderer* self);
void renderer_update(Renderer* self);
void renderer_present(Renderer* self);

void renderer_world_position_from_window_position
(
	Renderer* self, 
	vec2 windowPosition, 
	vec2 rendererPosition
);
