Updated to use JGL

This commit is contained in:
2025-02-01 11:40:21 -05:00
parent 29c32f6d9a
commit 583315193d

View File

@@ -1,32 +1,30 @@
// simple test program to open a window with
// a blue background.
#include <rewindow/types/window.h>
#include <rewindow/logger/logger.h>
#include <ReWindow/types/Window.h>
#include <ReWindow/Logger.h>
#include <GL/gl.h>
#define WIDTH 800
#define HEIGHT 600
class RandomWalkerWindow : public ReWindow::RWindow {
class RandomWalkerWindow : public ReWindow::OpenGLWindow {
public:
RandomWalkerWindow(const std::string& title, int width, int height)
: ReWindow::RWindow(title, width, 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);
GLSwapBuffers();
//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->SetRenderer(RenderingAPI::OPENGL);
std::unique_ptr<RandomWalkerWindow> window =
std::make_unique<RandomWalkerWindow>("Random Walker with ReWindow", WIDTH, HEIGHT);
window->Open();
while (!window->IsClosing()) {