Skip to content

Class Window

ClassList > Window

RAII owner of the GLFW library, OS window, and OpenGL context. More...

  • #include <Window.h>

Public Functions

Type Name
GLFWwindow * Get () const
Returns the native GLFW window handle.
bool ShouldClose () const
Returns true if the window has received a close request.
void SwapBuffers () const
Swaps front and back buffers.
Window (int width, int height, const std::string & title)
Initializes GLFW and creates an OpenGL 4.6 core-profile window.
Window (const Window &) = delete
Window & operator= (const Window &) = delete
~Window ()
Destroys the GLFW window and terminates the GLFW library.

Detailed Description

Initializes GLFW on construction and terminates it on destruction. After a successful construction the OpenGL 4.6 core-profile context is current on the calling thread and ready for use by Renderer and ImguiManager.

Note:

Non-copyable and non-movable.

Public Functions Documentation

function Get

Returns the native GLFW window handle.

inline GLFWwindow * Window::Get () const

Returns:

Non-owning pointer to GLFWwindow


function ShouldClose

Returns true if the window has received a close request.

inline bool Window::ShouldClose () const


function SwapBuffers

Swaps front and back buffers.

inline void Window::SwapBuffers () const


function Window [1/2]

Initializes GLFW and creates an OpenGL 4.6 core-profile window.

Window::Window (
    int width,
    int height,
    const std::string & title
) 

Enforces the required GLFW/GL initialization sequence: * glfwInit() * glfwCreateWindow() * glfwMakeContextCurrent()

Parameters:

Exception:

  • std::runtime_error on GLFW init or window creation failure

function Window [2/2]

Window::Window (
    const Window &
) = delete

function operator=

Window & Window::operator= (
    const Window &
) = delete

function ~Window

Destroys the GLFW window and terminates the GLFW library.

Window::~Window () 



The documentation for this class was generated from the following file src/app/Window.h