![]() |
AireEngine
A 3D Open-World Game Engine
|
#include <window.h>
Public Member Functions | |
| Window (int width, int height, const char *title, bool fullscreen=false) | |
| Window (const Window &)=delete | |
| Window & | operator= (const Window &)=delete |
| GLFWwindow * | getInternalPtr () |
| const char * | getTitle () const |
| IOHandler * | getIOHandler () const |
| int | getWidth () const |
| int | getHeight () const |
| void | getFramebufferSize (int &width, int &height) const |
| float | getAspectRatio () const |
| bool | isFullscreen () const |
| bool | isMinimized () const |
| bool | shouldClose () const |
| bool | toggleFullscreen () |
| void | attachIOHandler (IOHandler &handler) |
| void | setAsCurrentRenderWindow () |
| void | update () |
| Perform buffer swap and poll for I/O events. | |
| void | close () |
| Close the window. | |
| ~Window () | |
| Destroy the window. If this is the last window, terminate GLFW. | |
A wrapper class over a GLFWwindow. Creating a new window also creates the associated OpenGL context, so all OpenGL calls must be made after the window is created!
Multiple windows supported in theory but stability not guaranteed.
Create a new window object and set up the associated OpenGL context. The context is set as current automatically, so subsequent OpenGL commands will be affecting the last created window. On resize, OpenGL viewport gets resized automatically.
| width | The width of the window in GLFW screen coordinates. |
| height | The height of the window in GLFW screen coordinates. |
| title | The title of the window. |
| fullscreen | True if the window should be created in fullscreen mode. In that case, the width and height parameters will come in effect only when switching to windowed mode. |
Attach the specified IOHandler to this window. The handler will be used to handle key and mouse events.
| handler | The new IO handler. |
|
inline |
Calculate the aspect ration of the window (width/height).


Get the size of the window in pixels. This is guaranteed to match OpenGL's requirements for glViewport().
| width | An OUT parameter that will be set to the window's width in pixels. |
| height | An OUT parameter that will be set to the window's height in pixels. |

|
inline |

|
inline |

|
inline |

|
inline |
|
inline |

|
inline |
Specify that this is the window used for rendering. All subsequent OpenGL commands will be relative to the context of this window.
|
inline |
| bool Window::toggleFullscreen | ( | ) |
Toggle fullscreen mode on/off.
