123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #ifndef WINDOW_H
- #define WINDOW_H
- #include <GL/glew.h>
- #include <GLFW/glfw3.h>
- #include "input/TextInput.h"
- #include "rendering/WindowOptions.h"
- class Window final {
- TextInput& textInput;
- GLFWwindow* window;
- public:
- Window(TextInput& textInput, const WindowOptions& options);
- ~Window();
- Window(const Window&) = delete;
- Window& operator=(const Window&) = delete;
- Window(Window&&) = delete;
- Window& operator=(Window&&) = delete;
- bool hasError() const;
- void show();
- bool shouldClose() const;
- void swapBuffers();
- void trapCursor(bool trap);
- Size getSize() const;
- Size getFramebufferSize() const;
- bool isKeyDown(int key) const;
- bool isMouseDown(int mouse) const;
- void getMousePosition(double& x, double& y) const;
- private:
- static void keyCallback(GLFWwindow* w, int key, int scancode, int action,
- int mods);
- static void charCallback(GLFWwindow* w, unsigned int codepoint);
- };
- #endif
|