SimpleGL
1.1.0
A framework for platform independent rendering
|
This class provides a basic GLFW window. More...
#include <glfw_window.hpp>
Public Member Functions | |
~Window (void) | |
Destroys the window. More... | |
GLFWwindow * | getHandle () |
Returns the handle of the window. More... | |
int | getWidth () |
Returns the width of the drawing area. More... | |
void | setWidth (int width) |
Sets the width of the drawing area. More... | |
int | getHeight () |
Returns the height of the drawing area. More... | |
void | setHeight (int height) |
Sets the height of the drawing area. More... | |
glm::ivec2 | getSize () |
Returns the size of the drawing area. More... | |
void | setSize (glm::ivec2 size) |
Sets the size of the drawing area. More... | |
std::string | getTitle () |
Returns the window title. More... | |
void | setTitle (std::string title) |
Sets this windows title. More... | |
void | showInfoTitle () |
Shows informations in the title. More... | |
void | centerWindow () |
Centers the window on the primary screen. More... | |
void | setKeyCallback (KeyCallback *callback) |
Set the key callback. More... | |
void | setMouseButtonCallback (MouseButtonCallback *callback) |
Set the mouse button callback. More... | |
virtual void | swapBuffers ()=0 |
Swaps the framebuffers of this window. More... | |
void | update () |
Convenience method to swap buffers and poll events in one call. More... | |
bool | shouldClose () |
Checks the close flag for the window. More... | |
void | sync (int fps) |
Syncs the window framerate to specified FPS. More... | |
glm::dvec2 | getCursorPos () |
Gets the cursor position. More... | |
double | getCursorX () |
Gets the cursor's X-position. More... | |
double | getCursorY () |
Gets the cursor's Y-position. More... | |
Protected Member Functions | |
Window (void) | |
Initializes a new window. More... | |
Protected Attributes | |
GLFWwindow * | handle |
The handle for the GLFW window. More... | |
glm::ivec2 | size |
The size of the drawing area. More... | |
std::string | title |
The title for the GLFW window. More... | |
This class provides a basic GLFW window.
Definition at line 29 of file glfw_window.hpp.
|
protected |
Initializes a new window.
Definition at line 20 of file glfw_window.cpp.
sgl::Window::~Window | ( | void | ) |
Destroys the window.
Definition at line 24 of file glfw_window.cpp.
void sgl::Window::centerWindow | ( | ) |
Centers the window on the primary screen.
Definition at line 84 of file glfw_window.cpp.
glm::dvec2 sgl::Window::getCursorPos | ( | ) |
Gets the cursor position.
Definition at line 126 of file glfw_window.cpp.
double sgl::Window::getCursorX | ( | ) |
Gets the cursor's X-position.
Definition at line 132 of file glfw_window.cpp.
double sgl::Window::getCursorY | ( | ) |
Gets the cursor's Y-position.
Definition at line 136 of file glfw_window.cpp.
GLFWwindow * sgl::Window::getHandle | ( | ) |
Returns the handle of the window.
Definition at line 28 of file glfw_window.cpp.
int sgl::Window::getHeight | ( | ) |
Returns the height of the drawing area.
Definition at line 44 of file glfw_window.cpp.
glm::ivec2 sgl::Window::getSize | ( | ) |
Returns the size of the drawing area.
Definition at line 56 of file glfw_window.cpp.
std::string sgl::Window::getTitle | ( | ) |
int sgl::Window::getWidth | ( | ) |
Returns the width of the drawing area.
Definition at line 32 of file glfw_window.cpp.
void sgl::Window::setHeight | ( | int | height | ) |
Sets the height of the drawing area.
height | The new height of the drawing area. |
Definition at line 48 of file glfw_window.cpp.
void sgl::Window::setKeyCallback | ( | KeyCallback * | callback | ) |
Set the key callback.
callback | Pointer to the key callback. |
Definition at line 89 of file glfw_window.cpp.
void sgl::Window::setMouseButtonCallback | ( | MouseButtonCallback * | callback | ) |
Set the mouse button callback.
callback | Pointer to the mouse button callback. |
Definition at line 94 of file glfw_window.cpp.
void sgl::Window::setSize | ( | glm::ivec2 | size | ) |
Sets the size of the drawing area.
size | The new size of the drawing area. |
Definition at line 60 of file glfw_window.cpp.
void sgl::Window::setTitle | ( | std::string | title | ) |
Sets this windows title.
title | The new title of the window. |
Definition at line 72 of file glfw_window.cpp.
void sgl::Window::setWidth | ( | int | width | ) |
Sets the width of the drawing area.
width | The new width of the drawing area. |
Definition at line 36 of file glfw_window.cpp.
bool sgl::Window::shouldClose | ( | ) |
Checks the close flag for the window.
Definition at line 104 of file glfw_window.cpp.
void sgl::Window::showInfoTitle | ( | ) |
Shows informations in the title.
Definition at line 77 of file glfw_window.cpp.
|
pure virtual |
Swaps the framebuffers of this window.
Implemented in sgl::WindowVK, and sgl::WindowGL.
void sgl::Window::sync | ( | int | fps | ) |
Syncs the window framerate to specified FPS.
fps | The desired FPS. |
Definition at line 108 of file glfw_window.cpp.
void sgl::Window::update | ( | ) |
Convenience method to swap buffers and poll events in one call.
Definition at line 99 of file glfw_window.cpp.
|
protected |
The handle for the GLFW window.
Definition at line 33 of file glfw_window.hpp.
|
protected |
The size of the drawing area.
Definition at line 36 of file glfw_window.hpp.
|
protected |
The title for the GLFW window.
Definition at line 39 of file glfw_window.hpp.