22d2bb1c40
Extract GLFW window management into a dedicated cbt::window class (new files in cbt/). The opengl::context now only handles GLAD setup and context activation (no more window creation or GLFW init/terminate). Updated main loop in cuber.cpp, CMakeLists.txt (to build the new source), and AGENTS.md (docs + source layout). Addresses the design note in context.cpp about mixing concerns.
22 lines
297 B
C++
22 lines
297 B
C++
#pragma once
|
|
|
|
#include "cbt/window.hpp"
|
|
|
|
namespace cbt::opengl {
|
|
|
|
class context {
|
|
public:
|
|
explicit context(window const& win);
|
|
~context();
|
|
|
|
auto valid() const -> bool;
|
|
|
|
private:
|
|
bool m_valid = false;
|
|
|
|
static auto setup_gl() -> bool;
|
|
static auto print_info() -> void;
|
|
};
|
|
|
|
}
|