5 #define GL_SILENCE_DEPRECATION 9 #include <GLFW/glfw3.h> 10 #include <glm/glm.hpp> 14 namespace fireworks {
namespace graphics {
17 #define MAX_BUTTONS 32 160 static void key_callback(GLFWwindow* window,
int key,
int scancode,
int action,
int mods);
180 int m_Width, m_Height;
181 GLFWwindow* m_Window;
199 Window(
const char *title,
int width,
int height);
246 bool isKeyHeld(
unsigned int keycode)
const;
282 friend void key_callback(GLFWwindow* window,
int key,
int scancode,
int action,
int mods);
~Window()
Definition: Window.cpp:29
void update() const
Updates the window.
Definition: Window.cpp:148
void getMousePosition(double &x, double &y) const
Gets the current position of the mouse in Screen Space Coordinates.
Definition: Window.cpp:136
void key_callback(GLFWwindow *window, int key, int scancode, int action, int mods)
Definition: Window.cpp:170
friend void key_callback(GLFWwindow *window, int key, int scancode, int action, int mods)
A callback function called when the windows registers a key press from the Keyboard.
Definition: Window.cpp:170
void mouse_button_callback(GLFWwindow *window, int button, int action, int mods)
Definition: Window.cpp:195
bool isMouseButtonHeld(unsigned int button) const
Tells if a particular key on the Mouse button is being held or not.
Definition: Window.cpp:127
void mouse_position_callback(GLFWwindow *window, double xpos, double ypos)
Definition: Window.cpp:204
int getWidth() const
Gets the current width of the window.
Definition: Window.h:219
int getHeight() const
Gets the current height of the window.
Definition: Window.h:223
friend void mouse_position_callback(GLFWwindow *window, double xpos, double ypos)
A callback function called when the windows registers a change in the mouse position.
Definition: Window.cpp:204
Keys
All Input Buttons mapped to a more understandable mapping from GLFW.
Definition: Window.h:20
bool closed() const
Indicates the current state of the Window.
Definition: Window.cpp:160
friend void mouse_button_callback(GLFWwindow *window, int button, int action, int mods)
A callback function called when the windows registers a button press from the Mouse.
Definition: Window.cpp:195
Definition: audioclip.cpp:3
float deltaMouseX
Definition: Window.h:175
friend void window_resize_callback(GLFWwindow *window, int width, int height)
A callback function called when the windows resizes.
Definition: Window.cpp:187
The class responsible for Window Creation.
Definition: Window.h:168
glm::vec4 backgroundColor
The background color of the Window.
Definition: Window.h:174
#define MAX_BUTTONS
Definition: Window.h:17
bool isMouseButtonPressed(unsigned int button)
Tells if a particular key on the Mouse button was pressed or not.
Definition: Window.cpp:105
void window_resize_callback(GLFWwindow *window, int width, int height)
Definition: Window.cpp:187
void glfw_initialisation_error(int error, const char *description)
Input related GLFW callback functions.
Definition: Window.cpp:165
Window(const char *title, int width, int height)
Creates a Window by initializing GLFW.
Definition: Window.cpp:5
float deltaMouseY
Definition: Window.h:176
GLFWwindow * getGLFWwindow() const
Gets the current window's pointer to it's native object.
Definition: Window.h:227
#define MAX_KEYS
Definition: Window.h:16
void clear() const
Clears the window screen blank.
Definition: Window.cpp:142
bool isMouseButtonReleased(unsigned int button)
Definition: Window.cpp:116
bool isKeyPressed(unsigned int keycode)
Tells if a particular key on the keyboard was pressed or not.
Definition: Window.cpp:74
bool isKeyHeld(unsigned int keycode) const
Tells if a particular key on the keyboard is being held or not.
Definition: Window.cpp:96
bool isKeyReleased(unsigned int keycode)
Tells if a particular key on the keyboard was released or not.
Definition: Window.cpp:85