forked from rich/ReWalker
Add test.cpp
This commit is contained in:
31
test.cpp
Normal file
31
test.cpp
Normal 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;
|
||||||
|
}
|
Reference in New Issue
Block a user