From d8c33665082f25bba1784a6825c4e4514b970ebd Mon Sep 17 00:00:00 2001 From: rich Date: Fri, 10 Jan 2025 14:26:34 -0500 Subject: [PATCH] Add test.cpp --- test.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test.cpp diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..68f60e4 --- /dev/null +++ b/test.cpp @@ -0,0 +1,31 @@ +// simple test program to open a window with +// a blue background. + +#include +#include +#include + +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; +}