#pragma once

#include <GL/glew.h>
#include <GL/gl.h>

#include "window.h"

#define CAMERA_ORTHOGRAPHIC_FAR -1.0f
#define CAMERA_ORTHOGRAPHIC_NEAR 1.0f

typedef enum CameraType
{
	CAMERA_PERSPECTIVE, // unsupported
	CAMERA_ORTHOGRAPHIC
} CameraType;

typedef struct Camera
{
	CameraType type;
	vec3 position;
	f32 yaw;
	f32 pitch;
	union
	{
		struct 
		{
			vec2 size;
		} orthographic;
		struct
		{
			f32 fov;
			f32 aspect;
		} perspective;
	};
} Camera;

void camera_orthographic_init(Camera* self, vec2 size);
void camera_orthographic_window_set(Camera* self, Window* window);
void camera_position_set(Camera* self, vec3 position);
void camera_projection_get(Camera* self, mat4 projection);
void camera_view_get(Camera* self, mat4 view);
