47d01f57c0
- 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
29 lines
543 B
C++
29 lines
543 B
C++
#define GLFW_INCLUDE_NONE
|
|
#include "GLFW/glfw3.h"
|
|
|
|
#include "cbt/window.hpp"
|
|
|
|
#include "glad/glad.h"
|
|
|
|
auto main(int, char const*[]) -> int {
|
|
auto w = cbt::window("cuber", 1280, 720);
|
|
|
|
if (!w.valid()) {
|
|
return 1;
|
|
}
|
|
|
|
while (!w.should_close()) {
|
|
if (glfwGetKey(static_cast<GLFWwindow*>(w.raw()), GLFW_KEY_Q) == GLFW_PRESS) {
|
|
break;
|
|
}
|
|
|
|
glClearColor(0.6f, 0.8f, 1.0f, 1.0f);
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
|
|
w.swap_buffers();
|
|
w.poll_events();
|
|
}
|
|
|
|
return 0;
|
|
}
|