From 09535633913069f4653c270501059c38c2d09a99 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Fri, 4 May 2018 18:36:07 +0100 Subject: Adding a core component, and removing implementation from yage.h --- yage/core/core.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 yage/core/core.cpp (limited to 'yage/core/core.cpp') diff --git a/yage/core/core.cpp b/yage/core/core.cpp new file mode 100644 index 00000000..63051a49 --- /dev/null +++ b/yage/core/core.cpp @@ -0,0 +1,37 @@ +/** --------------------------------------------------------------------------- + * @file: core.cpp + * + * Copyright (c) 2017 Yann Herklotz Grave + * MIT License, see LICENSE file for more details. + * ---------------------------------------------------------------------------- + */ + +#include "core.h" + +#include + +#include +#include + +namespace yage +{ + +void glfwErrorCallback(int, const char *description) +{ + std::cerr << "Error: " << description; +} + +void init() +{ + glfwSetErrorCallback(glfwErrorCallback); + if (glfwInit() == GLFW_FALSE) { + throw std::runtime_error("GLFW couldn't be initialised"); + } +} + +void quit() +{ + glfwTerminate(); +} + +} // namespace yage -- cgit