diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-09-20 23:01:12 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-09-20 23:01:12 +0100 |
commit | 977b8f16d7ef43101b6ef588f9610f34285fa7e6 (patch) | |
tree | 25446bc027685765a79492d3b68c49bdee53612b /yage/yage.cpp | |
parent | b869c926429e9316617a643960a97fad64dd42ef (diff) | |
download | YAGE-977b8f16d7ef43101b6ef588f9610f34285fa7e6.tar.gz YAGE-977b8f16d7ef43101b6ef588f9610f34285fa7e6.zip |
Replacing SDL by glfw
Diffstat (limited to 'yage/yage.cpp')
-rw-r--r-- | yage/yage.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/yage/yage.cpp b/yage/yage.cpp index fa1e5c36..a141d9aa 100644 --- a/yage/yage.cpp +++ b/yage/yage.cpp @@ -8,17 +8,29 @@ #include "yage.h" +#include <GLFW/glfw3.h> + +#include <stdexcept> + namespace yage { -bool init() +void glfwErrorCallback(int, const char *description) +{ + fprintf(stderr, "ERROR: %s\n", description); +} + +void init() { - return SDL_Init(SDL_INIT_VIDEO); + glfwSetErrorCallback(glfwErrorCallback); + if (!glfwInit()) { + throw std::runtime_error("GLFW couldn't be initialised"); + } } void quit() { - SDL_Quit(); + glfwTerminate(); } } // namespace yage |