feat: add RAII window class with OpenGL 4.1 context
- Add cbt::window class in cbt/ directory with RAII lifecycle - Add setup_opengl and info_opengl for glad init and GL info - Add Q key to quit the application - Update CMakeLists.txt with glfw3 and glad dependencies - Update AGENTS.md with snake_case naming and shell conventions
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace cbt {
|
||||
|
||||
class window {
|
||||
void* m_window = nullptr;
|
||||
bool m_initialized = false;
|
||||
|
||||
static auto init() -> bool;
|
||||
static auto terminate() -> void;
|
||||
static auto setup_opengl() -> bool;
|
||||
static auto info_opengl() -> void;
|
||||
|
||||
public:
|
||||
explicit window(std::string title, int width, int height);
|
||||
~window();
|
||||
|
||||
auto should_close() const -> bool;
|
||||
auto valid() const -> bool;
|
||||
auto swap_buffers() -> void;
|
||||
auto poll_events() -> void;
|
||||
auto raw() const -> void* { return m_window; }
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user