aboutsummaryrefslogtreecommitdiff
path: root/src/glfw/guard.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/glfw/guard.h')
-rw-r--r--src/glfw/guard.h20
1 files changed, 20 insertions, 0 deletions
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 <GL/glew.h>
+#include <GLFW/glfw3.h>
+
+class GlfwGuard {
+private:
+ bool _good = false;
+public:
+ GlfwGuard() {
+ _good = glfwInit();
+ }
+ ~GlfwGuard() {
+ glfwTerminate();
+ }
+
+ bool isGood() const {
+ return _good;
+ }
+};