#pragma once

#include <SDL2/SDL.h>

#include "renderer.h"

#define MOUSE_BUTTON_COUNT MOUSE_BUTTON_X2 + 1
typedef enum MouseButtonType
{
	MOUSE_BUTTON_NONE,
	MOUSE_BUTTON_LEFT,
	MOUSE_BUTTON_MIDDLE,
	MOUSE_BUTTON_RIGHT,
	MOUSE_BUTTON_X1,
	MOUSE_BUTTON_X2
} MouseButtonType;

typedef struct Mouse
{
	ivec2 position;
	bool current[MOUSE_BUTTON_COUNT];
	bool previous[MOUSE_BUTTON_COUNT];
} Mouse;

void mouse_update(Mouse* self);
bool mouse_press(Mouse* self, MouseButtonType type);
bool mouse_held(Mouse* self, MouseButtonType type);
bool mouse_release(Mouse* self, MouseButtonType type);
void mouse_world_position_get(Mouse* mouse, Renderer* renderer, vec2 position);
f32 mouse_angle_from_world_position_get(Mouse* self, Renderer* renderer, vec2 position);
