From 977b8f16d7ef43101b6ef588f9610f34285fa7e6 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 20 Sep 2017 23:01:12 +0100 Subject: Replacing SDL by glfw --- yage/yage.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'yage/yage.cpp') 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 + +#include + 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 -- cgit