changed to use smart pointer for window handle

This commit is contained in:
rich
2025-01-13 10:24:35 -05:00
parent d8c3366508
commit 01f2acca60

View File

@@ -5,9 +5,13 @@
#include <rewindow/logger/logger.h>
#include <GL/gl.h>
class TestWindow : public ReWindow::RWindow {
#define WIDTH 800
#define HEIGHT 600
class RandomWalkerWindow : public ReWindow::RWindow {
public:
TestWindow(const std::string& title, int width, int height)
RandomWalkerWindow(const std::string& title, int width, int height)
: ReWindow::RWindow(title, width, height) {}
void OnRefresh(float elapsed) override {
@@ -18,7 +22,10 @@ public:
};
int main() {
auto* window = new TestWindow("Test Window", 800, 600);
std::unique_ptr<RandomWalkerWindow> window =
std::make_unique<RandomWalkerWindow>("Random Walker with ReWindow", WIDTH, HEIGHT);
window->SetRenderer(RenderingAPI::OPENGL);
window->Open();
@@ -26,6 +33,5 @@ int main() {
window->ManagedRefresh();
}
delete window;
return 0;
}