forked from rich/ReWalker
35 lines
851 B
C++
35 lines
851 B
C++
// simple test program to open a window with
|
|
// a blue background.
|
|
|
|
#include <ReWindow/types/Window.h>
|
|
#include <ReWindow/Logger.h>
|
|
#include <GL/gl.h>
|
|
|
|
#define WIDTH 800
|
|
#define HEIGHT 600
|
|
|
|
|
|
class RandomWalkerWindow : public ReWindow::OpenGLWindow {
|
|
public:
|
|
RandomWalkerWindow(const std::string& title, int width, int height)
|
|
: ReWindow::OpenGLWindow(title, width, height, 2, 1) {}
|
|
|
|
void OnRefresh(float elapsed) override {
|
|
//glClearColor(0.0f, 0.0f, 1.0f, 1.0f); // Clear with blue
|
|
//glClear(GL_COLOR_BUFFER_BIT);
|
|
SwapBuffers();
|
|
}
|
|
};
|
|
|
|
int main() {
|
|
|
|
std::unique_ptr<RandomWalkerWindow> window =
|
|
std::make_unique<RandomWalkerWindow>("Random Walker with ReWindow", WIDTH, HEIGHT);
|
|
window->Open();
|
|
|
|
while (!window->IsClosing()) {
|
|
window->ManagedRefresh();
|
|
}
|
|
|
|
return 0;
|
|
} |