diff --git a/lib/Ray/Vector.hpp b/lib/Ray/Vector.hpp new file mode 100644 index 00000000..fdaeca4e --- /dev/null +++ b/lib/Ray/Vector.hpp @@ -0,0 +1,18 @@ +/* +** EPITECH PROJECT, 2021 +** Bomberman +** File description: +** Vector +*/ + +#ifndef VECTOR_HPP_ +#define VECTOR_HPP_ + +#include + +namespace Ray { + typedef Vector2 Vector2; + typedef Vector3 Vector3; +} + +#endif /* !VECTOR_HPP_ */ diff --git a/lib/Ray/Window.hpp b/lib/Ray/Window.hpp new file mode 100644 index 00000000..efa5ea98 --- /dev/null +++ b/lib/Ray/Window.hpp @@ -0,0 +1,58 @@ +/* +** EPITECH PROJECT, 2021 +** Bomberman +** File description: +** Window +*/ + +#ifndef WINDOW_HPP_ +#define WINDOW_HPP_ + +#include +#include +#include "Vector.hpp" + +namespace Ray { +class Window { + public: + // Creates window, and opens it if openNow is set to true + Window(int width, int height, const std::string title, bool openNow = false); + + //Closes window if still open + ~Window() = default; + + // Initialize window and OpenGL context + bool open(void); + + // Check if KEY_ESCAPE pressed or Close icon pressed + bool shouldClose(void) const; + + // Close window and unload OpenGL context + bool close(void); + + // Check if window is currently focused + bool isFocused(void); + + // Set window dimensions + const Ray::Vector2 &getDimensions(void) const; + + // Shows cursor + void showCursor(void); + + // Hides cursor + void hideCursor(void); + + // Check if cursor is not visible + bool cursorIsHidden(void) const; + + // Check if cursor is on the current screen. + bool cursorIsOnScreen(void) const; + + private: + Ray::Vector2 _dimensions; + std::string _title; + bool _isOpen; +}; +} + +#endif /* !WINDOW_HPP_ */