#define GLFW_INCLUDE_NONE #include "GLFW/glfw3.h" #include "cbt/opengl/context.hpp" #include #include #include "glad/glad.h" auto main(int, char const*[]) -> int { auto ctx = cbt::opengl::context("cuber", 1280, 720); if (!ctx.valid()) { return 1; } asio::io_context io; asio::signal_set signals(io, SIGINT, SIGTERM); bool quit = false; signals.async_wait([&](auto, auto) { quit = true; io.stop(); }); auto process_signals = [&]() -> void { while (io.poll()) {} }; while (!ctx.should_close()) { process_signals(); if (quit || glfwGetKey(ctx.raw(), GLFW_KEY_Q) == GLFW_PRESS) { break; } glClearColor(0.6f, 0.8f, 1.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); ctx.swap_buffers(); ctx.poll_events(); } return 0; }