move test guis to GUImodules and separate utils from modules

This commit is contained in:
2025-03-21 12:01:19 -05:00
parent 028162509e
commit 719af8e85a
11 changed files with 23 additions and 3 deletions

View File

@@ -0,0 +1,36 @@
#include "Archimedes.h"
#include "windowGLFW.h"
Window::Window() {
glfwSetErrorCallback([](int e, const char* m){
std::cout << "GLFW Error: " << m << std::endl;
});
if(!glfwInit()) {
std::cout << "glfwInit failed!\n";
std::abort();
}
w = glfwCreateWindow(640, 480, "Archimedes", NULL, NULL);
if(!w) {
glfwTerminate();
std::abort();
}
glfwMakeContextCurrent(w);
}
bool Window::shouldClose() {
return glfwWindowShouldClose(w);
}
void Window::doFrame() {
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(w);
glfwPollEvents();
}
Window::~Window() {
glfwTerminate();
}