From 5157658ec0cc07d2c56c978ca010cbb78236439f Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 25 May 2018 23:17:33 +0200 Subject: Guard GLFW init and termination --- src/glfw_guard.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/glfw_guard.h (limited to 'src/glfw_guard.h') diff --git a/src/glfw_guard.h b/src/glfw_guard.h new file mode 100644 index 0000000..37d3ffb --- /dev/null +++ b/src/glfw_guard.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include + +class GlfwGuard { +private: + bool _good = false; +public: + GlfwGuard() { + _good = glfwInit(); + } + ~GlfwGuard() { + glfwTerminate(); + } + + bool isGood() const { + return _good; + } +}; -- cgit v1.2.3