#ifndef COUCH_H #define COUCH_H #include #include #include #include "types.h" #include "Window.h" typedef void (*KeyHandler)(int key, int code, int action, int mods); typedef void (*MousePositionHandler)(double xpos, double ypos, double xrel, double yrel); class Input { public: static Input *GetInstance(); void Use(Window window); std::vector keyHandlers; std::vector mousePositionHandlers; private: bool firstMousePositionUpdate = true; double lastx, lasty; Input(); static void HandleKeys(GLFWwindow *_, int key, int code, int action, int mods); static void HandleMousePosition(GLFWwindow *_, double xpos, double ypos); static Input *instance; }; #endif // COUCH_H