forked from rich/ReWalker
changed window handle to smart pointer
This commit is contained in:
16
test.cpp
16
test.cpp
@@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user