2022-05-28 16:49:08 +00:00
|
|
|
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include "Graphics/Window.h"
|
2022-06-10 20:44:40 +00:00
|
|
|
#include "EventSystem/EventEmitter.h"
|
2022-05-28 16:49:08 +00:00
|
|
|
|
|
|
|
namespace BarinkEngine {
|
|
|
|
|
2022-06-10 20:44:40 +00:00
|
|
|
class InputManager : EventEmitter {
|
2022-05-28 16:49:08 +00:00
|
|
|
public:
|
|
|
|
InputManager();
|
|
|
|
|
|
|
|
void PollEvents();
|
|
|
|
void attach(BarinkWindow* window);
|
|
|
|
|
2022-06-10 19:06:45 +00:00
|
|
|
|
2022-06-10 20:44:40 +00:00
|
|
|
|
2022-06-10 19:06:45 +00:00
|
|
|
// GLFW Handlers
|
|
|
|
static void KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
|
|
|
|
static void CursorPositionCallback(GLFWwindow* window, double x, double y);
|
|
|
|
static void CursorEnterCallback(GLFWwindow* window, int entered);
|
|
|
|
static void MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
|
|
|
|
static void ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
|
2022-05-28 16:49:08 +00:00
|
|
|
private:
|
|
|
|
std::vector<BarinkWindow*> windows;
|
2022-06-10 20:44:40 +00:00
|
|
|
|
2022-05-28 16:49:08 +00:00
|
|
|
};
|
|
|
|
}
|