Updated to use JGL
This commit is contained in:
20
test.cpp
20
test.cpp
@@ -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()) {
|
||||
|
Reference in New Issue
Block a user