Skip to content

File Window.h

FileList > app > Window.h

Go to the source code of this file

RAII wrapper for GLFW initialization and window/context lifecycle. More...

  • #include <GLFW/glfw3.h>
  • #include <stdexcept>
  • #include <string>

Classes

Type Name
class Window
RAII owner of the GLFW library, OS window, and OpenGL context.

Detailed Description

Window encapsulates the GLFW library init, OS window creation, and OpenGL context activation. Constructing a Window object guarantees steps 1–3 of the required initialization order:

  • glfwInit()
  • glfwCreateWindow()
  • glfwMakeContextCurrent()

Components that require an active OpenGL context (e.g., Renderer, ImguiManager) must take Window& in their constructor to statically enforce that the context is ready before they initialize.

Note:

Thread-safety: Must be created and used from the main thread only.


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