#include "Archimedes.h" #include "WindowGLFW.h" namespace Archimedes { WindowGLFW::WindowGLFW() { glfwSetErrorCallback([](int e, const char* m){ std::cout << "GLFW Error: " << m << std::endl; }); if(!glfwInit()) { std::cout << "glfwInit failed!\n"; std::abort(); } w = glfwCreateWindow(640, 480, "Archimedes", NULL, NULL); if(!w) { glfwTerminate(); std::abort(); } glfwMakeContextCurrent(w); } bool WindowGLFW::shouldClose() { return glfwWindowShouldClose(w); } void WindowGLFW::doFrame() { glClear(GL_COLOR_BUFFER_BIT); glfwSwapBuffers(w); glfwPollEvents(); } WindowGLFW::~WindowGLFW() { glfwTerminate(); } }