Skip to main content

GLFWRAIIGuard Class

A RAII Guard for GLFW. More...

Declaration

class helios::ext::glfw::app::GLFWRAIIGuard { ... }

Public Constructors Index

GLFWRAIIGuard ()

Initializes the glfw library by calling `glfwInit()`. More...

GLFWRAIIGuard (const GLFWRAIIGuard &)=delete

No copy or move. More...

GLFWRAIIGuard (const GLFWRAIIGuard &&)=delete

Public Destructor Index

~GLFWRAIIGuard ()

Terminates the glfw library by calling `glfwTerminate()`. More...

Public Operators Index

GLFWRAIIGuard &operator= (const GLFWRAIIGuard &)=delete
GLFWRAIIGuard &operator= (const GLFWRAIIGuard &&)=delete

Description

A RAII Guard for GLFW.

This class makes sure that GLFW is properly initialized when an instance is created and terminated when this instance is destroyed.

See Also

https://en.cppreference.com/w/cpp/language/raii.html

Definition at line 22 of file GLFWRAIIGuard.ixx.

Public Constructors

GLFWRAIIGuard()

helios::ext::glfw::app::GLFWRAIIGuard::GLFWRAIIGuard ()
inline

Initializes the glfw library by calling `glfwInit()`.

Exceptions
std::runtime_error

if initialization fails

See Also

https://www.glfw.org/docs/latest/group__init.html#ga317aac130a235ab08c6db0834907d85e

Definition at line 32 of file GLFWRAIIGuard.ixx.

33 if (glfwInit() == GLFW_FALSE) {
34 throw std::runtime_error("Failed to initialize glfw");
35 }
36 }

Referenced by GLFWRAIIGuard, GLFWRAIIGuard, operator= and operator=.

GLFWRAIIGuard()

helios::ext::glfw::app::GLFWRAIIGuard::GLFWRAIIGuard (const GLFWRAIIGuard &)
delete

No copy or move.

Definition at line 51 of file GLFWRAIIGuard.ixx.

Reference GLFWRAIIGuard.

GLFWRAIIGuard()

helios::ext::glfw::app::GLFWRAIIGuard::GLFWRAIIGuard (const GLFWRAIIGuard &&)
delete

Definition at line 53 of file GLFWRAIIGuard.ixx.

Reference GLFWRAIIGuard.

Public Destructor

~GLFWRAIIGuard()

helios::ext::glfw::app::GLFWRAIIGuard::~GLFWRAIIGuard ()
inline

Terminates the glfw library by calling `glfwTerminate()`.

See Also

https://www.glfw.org/docs/latest/group__init.html#gaaae48c0a18607ea4a4ba951d939f0901

Definition at line 44 of file GLFWRAIIGuard.ixx.

45 glfwTerminate();
46 }

Public Operators

operator=()

GLFWRAIIGuard & helios::ext::glfw::app::GLFWRAIIGuard::operator= (const GLFWRAIIGuard &)
delete

Definition at line 52 of file GLFWRAIIGuard.ixx.

Reference GLFWRAIIGuard.

operator=()

GLFWRAIIGuard & helios::ext::glfw::app::GLFWRAIIGuard::operator= (const GLFWRAIIGuard &&)
delete

Definition at line 54 of file GLFWRAIIGuard.ixx.

Reference GLFWRAIIGuard.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.