aboutsummaryrefslogtreecommitdiffstats
path: root/yage/yage.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-09-22 00:02:59 +0100
committerYann Herklotz <ymherklotz@gmail.com>2017-09-22 00:02:59 +0100
commit5deb18b72a4993a4baf59b7da24a04116eab31e6 (patch)
treec7a1523bed9bf7629b311d63e212957a6ae735be /yage/yage.cpp
parent34396f0483d94229e3a315e5eeb90c77c1425273 (diff)
parente8208166c67e564fb249aa41e9f8c5e2fa1f2b9a (diff)
downloadYAGE-5deb18b72a4993a4baf59b7da24a04116eab31e6.tar.gz
YAGE-5deb18b72a4993a4baf59b7da24a04116eab31e6.zip
Merge branch 'develop'
Diffstat (limited to 'yage/yage.cpp')
-rw-r--r--yage/yage.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/yage/yage.cpp b/yage/yage.cpp
new file mode 100644
index 00000000..a141d9aa
--- /dev/null
+++ b/yage/yage.cpp
@@ -0,0 +1,36 @@
+/* ----------------------------------------------------------------------------
+ * yage.h
+ *
+ * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
+ * See file LICENSE for more details
+ * ----------------------------------------------------------------------------
+ */
+
+#include "yage.h"
+
+#include <GLFW/glfw3.h>
+
+#include <stdexcept>
+
+namespace yage
+{
+
+void glfwErrorCallback(int, const char *description)
+{
+ fprintf(stderr, "ERROR: %s\n", description);
+}
+
+void init()
+{
+ glfwSetErrorCallback(glfwErrorCallback);
+ if (!glfwInit()) {
+ throw std::runtime_error("GLFW couldn't be initialised");
+ }
+}
+
+void quit()
+{
+ glfwTerminate();
+}
+
+} // namespace yage