Add test.cpp

This commit is contained in:
rich
2025-01-10 14:26:34 -05:00
parent a0352d9263
commit d8c3366508

31
test.cpp Normal file
View File

@@ -0,0 +1,31 @@
// simple test program to open a window with
// a blue background.
#include <rewindow/types/window.h>
#include <rewindow/logger/logger.h>
#include <GL/gl.h>
class TestWindow : public ReWindow::RWindow {
public:
TestWindow(const std::string& title, int width, int height)
: ReWindow::RWindow(title, width, height) {}
void OnRefresh(float elapsed) override {
glClearColor(0.0f, 0.0f, 1.0f, 1.0f); // Clear with blue
glClear(GL_COLOR_BUFFER_BIT);
GLSwapBuffers();
}
};
int main() {
auto* window = new TestWindow("Test Window", 800, 600);
window->SetRenderer(RenderingAPI::OPENGL);
window->Open();
while (!window->IsClosing()) {
window->ManagedRefresh();
}
delete window;
return 0;
}