90d013695d
- Replace window class with cbt::opengl::context - Add buffer resource (VBO, EBO, UBO, SSBO) with move semantics - Add texture resource with format/type enums and filtering - Add descriptor_set for Vulkan-style resource binding - All resources use RAII with proper cleanup
31 lines
606 B
C++
31 lines
606 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#define GLFW_INCLUDE_NONE
|
|
#include "GLFW/glfw3.h"
|
|
|
|
namespace cbt::opengl {
|
|
|
|
class context {
|
|
GLFWwindow* m_window = nullptr;
|
|
bool m_initialized = false;
|
|
|
|
static auto init() -> bool;
|
|
static auto terminate() -> void;
|
|
static auto setup_gl() -> bool;
|
|
static auto print_info() -> void;
|
|
|
|
public:
|
|
explicit context(std::string title, int width, int height);
|
|
~context();
|
|
|
|
auto should_close() const -> bool;
|
|
auto valid() const -> bool;
|
|
auto swap_buffers() -> void;
|
|
auto poll_events() -> void;
|
|
auto raw() const -> GLFWwindow*;
|
|
};
|
|
|
|
}
|