Window with own structure

This commit is contained in:
2026-02-20 02:05:56 +00:00
parent eb79d538de
commit 294edcdcff
10 changed files with 93 additions and 42 deletions

22
cve_window.cpp Normal file
View File

@@ -0,0 +1,22 @@
#include "cve_window.hpp"
namespace cve {
CveWindow::CveWindow(int w, int h, std::string name) : width{w},
height{h}, windowName{name} {
initWindow();
}
CveWindow::~CveWindow() {
glfwDestroyWindow(window);
glfwTerminate();
}
void CveWindow::initWindow() {
glfwInit();
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
window = glfwCreateWindow(width, height,
windowName.c_str(), nullptr, nullptr);
}
}