The class responsible for Window Creation.
More...
#include <Window.h>
|
| 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. More...
|
| |
| void | window_resize_callback (GLFWwindow *window, int width, int height) |
| | A callback function called when the windows resizes. More...
|
| |
| 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. More...
|
| |
| void | mouse_position_callback (GLFWwindow *window, double xpos, double ypos) |
| | A callback function called when the windows registers a change in the mouse position. More...
|
| |
The class responsible for Window Creation.
Use this to create a new winnow of type GLFWwindow and manage input from the user and set various properties of the window
◆ Window()
| fireworks::graphics::Window::Window |
( |
const char * |
title, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Creates a Window by initializing GLFW.
- Parameters
-
| title | The title of the window |
| width | The width of the window |
| height | The height of the window |
◆ ~Window()
| fireworks::graphics::Window::~Window |
( |
| ) |
|
◆ clear()
| void fireworks::graphics::Window::clear |
( |
| ) |
const |
Clears the window screen blank.
Uses the data from the color, depth and stencil buffer bits to clear the window according the clearing rules
◆ closed()
| bool fireworks::graphics::Window::closed |
( |
| ) |
const |
Indicates the current state of the Window.
- Returns
- A bool indicating whether the window is closed or not
◆ getGLFWwindow()
| GLFWwindow* fireworks::graphics::Window::getGLFWwindow |
( |
| ) |
const |
|
inline |
Gets the current window's pointer to it's native object.
- Returns
- A a pointer variable to the windows GLFWwindow object
◆ getHeight()
| int fireworks::graphics::Window::getHeight |
( |
| ) |
const |
|
inline |
Gets the current height of the window.
- Returns
- An int denoting the current height of the graphics::Window
◆ getMousePosition()
| void fireworks::graphics::Window::getMousePosition |
( |
double & |
x, |
|
|
double & |
y |
|
) |
| const |
Gets the current position of the mouse in Screen Space Coordinates.
- Parameters
-
| x | A variable to the store the X coordinate of the mouse position |
| y | A variable to the store the Y coordinate of the mouse position |
◆ getWidth()
| int fireworks::graphics::Window::getWidth |
( |
| ) |
const |
|
inline |
Gets the current width of the window.
- Returns
- An int denoting the current width of the graphics::Window
◆ isKeyHeld()
| bool fireworks::graphics::Window::isKeyHeld |
( |
unsigned int |
keycode | ) |
const |
Tells if a particular key on the keyboard is being held or not.
- Note
- returns true for the entire duration of the key press
- Parameters
-
| keycode | The GLFW enum key code of the key to check it's status |
- Returns
- A bool indicating whether the key was being held or not
◆ isKeyPressed()
| bool fireworks::graphics::Window::isKeyPressed |
( |
unsigned int |
keycode | ) |
|
Tells if a particular key on the keyboard was pressed or not.
- Parameters
-
| keycode | The GLFW enum key code of the key to check it's status |
- Returns
- A bool indicating whether the key was pressed or not
◆ isKeyReleased()
| bool fireworks::graphics::Window::isKeyReleased |
( |
unsigned int |
keycode | ) |
|
Tells if a particular key on the keyboard was released or not.
- Parameters
-
| keycode | The GLFW enum key code of the key to check it's status |
- Returns
- A bool indicating whether the key was released after being pressed or not
◆ isMouseButtonHeld()
| bool fireworks::graphics::Window::isMouseButtonHeld |
( |
unsigned int |
button | ) |
const |
Tells if a particular key on the Mouse button is being held or not.
- Note
- returns true for the entire duration of the button press
- Parameters
-
| keycode | The GLFW enum button code of the key to check it's status |
- Returns
- A bool indicating whether the button was being held or not
◆ isMouseButtonPressed()
| bool fireworks::graphics::Window::isMouseButtonPressed |
( |
unsigned int |
button | ) |
|
Tells if a particular key on the Mouse button was pressed or not.
- Parameters
-
| keycode | The GLFW enum button code of the key to check it's status |
- Returns
- A bool indicating whether the button was pressed or not
◆ isMouseButtonReleased()
| bool fireworks::graphics::Window::isMouseButtonReleased |
( |
unsigned int |
button | ) |
|
◆ update()
| void fireworks::graphics::Window::update |
( |
| ) |
const |
Updates the window.
Checks for OpenGL errors and swaps the buffers after poling for input events
◆ key_callback
| void key_callback |
( |
GLFWwindow * |
window, |
|
|
int |
key, |
|
|
int |
scancode, |
|
|
int |
action, |
|
|
int |
mods |
|
) |
| |
|
friend |
A callback function called when the windows registers a key press from the Keyboard.
- Parameters
-
| window | The window that received the event |
| key | The keyboard key that was pressed or released |
| scancode | The system-specific scancode of the key |
| action | GLFW_PRESS, GLFW_RELEASE or GLFW_REPEAT |
| mods | Bit field describing which modifier keys were held down |
◆ mouse_button_callback
| void mouse_button_callback |
( |
GLFWwindow * |
window, |
|
|
int |
button, |
|
|
int |
action, |
|
|
int |
mods |
|
) |
| |
|
friend |
A callback function called when the windows registers a button press from the Mouse.
- Parameters
-
| window | The window that received the event |
| button | The mouse button that was pressed or released |
| action | GLFW_PRESS, GLFW_RELEASE or GLFW_REPEAT |
| mods | Bit field describing which modifier keys were held down |
◆ mouse_position_callback
| void mouse_position_callback |
( |
GLFWwindow * |
window, |
|
|
double |
xpos, |
|
|
double |
ypos |
|
) |
| |
|
friend |
A callback function called when the windows registers a change in the mouse position.
- Parameters
-
| window | The window that received the event |
| xpos | The new cursor x-coordinate, relative to the left edge of the content area |
| ypos | The new cursor y-coordinate, relative to the top edge of the content area |
◆ window_resize_callback
| void window_resize_callback |
( |
GLFWwindow * |
window, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
friend |
A callback function called when the windows resizes.
- Parameters
-
| window | The window that received the event |
| width | The new width of the window |
| height | The new height of the window |
◆ backgroundColor
| glm::vec4 fireworks::graphics::Window::backgroundColor |
The background color of the Window.
- Note
- This sets the color in the GL_COLOR_BUFFER_BIT
◆ deltaMouseX
| float fireworks::graphics::Window::deltaMouseX |
◆ deltaMouseY
| float fireworks::graphics::Window::deltaMouseY |
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/fireworks-engine/checkouts/latest/Fireworks Engine/Fireworks Core/src/graphics/Window.h
- /home/docs/checkouts/readthedocs.org/user_builds/fireworks-engine/checkouts/latest/Fireworks Engine/Fireworks Core/src/graphics/Window.cpp