#include #include #include #include "Window.hpp" #define APP_NAME "Meowcraft" #define WINDOW_WIDTH 1000 #define WINDOW_HEIGHT 800 void run(); void setup_gl(); int main() { glfwInit(); try { run(); } catch (std::runtime_error& error) { std::cout << "An error occurred: " << error.what() << std::endl; glfwTerminate(); return 1; } glfwTerminate(); return 0; } void run() { MC::Window window(APP_NAME, WINDOW_WIDTH, WINDOW_HEIGHT); setup_gl(); glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT); while (!window.should_close()) { window.start_frame(); if (window.key(GLFW_KEY_ESCAPE, GLFW_PRESS)) { window.close(); } } } void setup_gl() { GLenum error; if ((error = glewInit()) != GLEW_OK) { std::string error_string = std::string(reinterpret_cast(glewGetErrorString(error))); throw std::runtime_error("Failed to load GL functions: " + error_string); } }