#include #include #include #include "Defines.hpp" #include "Game.hpp" #include "Render.hpp" #include "ThreadRole.hpp" #include "World/World.hpp" int main() { HELLO_I_AM(MC::ThreadRole::Logic); if (!glfwInit()) { std::cout << "Failed to initialize GLFW" << std::endl; return 1; } try { MC::GFX::Window window(APP_NAME, WINDOW_WIDTH, WINDOW_HEIGHT); window.detach(); auto render_control = std::make_shared(); std::thread render_thread{[&window, render_control] { MC::Render render{window, render_control}; render.run(); }}; render_thread.detach(); MC::Game game{window, render_control}; game.run(); } catch (std::runtime_error& error) { std::cout << "An error occurred: " << error.what() << std::endl; glfwTerminate(); return 1; } glfwTerminate(); return 0; }