#pragma once

#include "keycode.h"
#include "../types/vec2.h"
#include <GLFW/glfw3.h>
#include <unordered_map>


class Input
{
public:
    static void Init(GLFWwindow* window);
    static void Update();

    static bool IsKeyDown(Keycode key);
    static bool IsKeyPressed(Keycode key);
    static bool IsKeyReleased(Keycode key);

    static bool IsMouseButtonDown(int button);
    static bool IsMouseButtonPressed(int button);
    static bool IsMouseButtonReleased(int button);

    static core::types::Vec2 GetMousePosition();

private:
    static inline GLFWwindow* s_Window = nullptr;

    static inline bool s_KeysCurrent[GLFW_KEY_LAST + 1]{};
    static inline bool s_KeysPrevious[GLFW_KEY_LAST + 1]{};

    static inline bool s_MouseCurrent[GLFW_MOUSE_BUTTON_LAST + 1]{};
    static inline bool s_MousePrevious[GLFW_MOUSE_BUTTON_LAST + 1]{};
};
