diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index a9890c3..77f155e 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,7 +1,7 @@ include("Macros") -add_subdirectory(display) +add_subdirectory(window) add_subdirectory(events) add_subdirectory(input) add_subdirectory(text) \ No newline at end of file diff --git a/examples/display/CMakeLists.txt b/examples/display/CMakeLists.txt deleted file mode 100644 index 05e659d..0000000 --- a/examples/display/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ - -#find_package(Spectre REQUIRED) - -set (SOURCE - DisplayExample.cpp - main.cpp -) - -spectre_example(display - main.cpp - DisplayExample.cpp -) diff --git a/examples/window/CMakeLists.txt b/examples/window/CMakeLists.txt new file mode 100644 index 0000000..334ff52 --- /dev/null +++ b/examples/window/CMakeLists.txt @@ -0,0 +1,7 @@ + +#find_package(Spectre REQUIRED) + +spectre_example(window + main.cpp + WindowExample.cpp +) diff --git a/examples/display/DisplayExample.cpp b/examples/window/WindowExample.cpp similarity index 88% rename from examples/display/DisplayExample.cpp rename to examples/window/WindowExample.cpp index 26a16ec..d629df3 100644 --- a/examples/display/DisplayExample.cpp +++ b/examples/window/WindowExample.cpp @@ -3,9 +3,9 @@ #include #include #include -#include "DisplayExample.h" +#include "WindowExample.h" -void DisplayExample::init() +void WindowExample::init() { m_renderer = new sp::BatchRenderer2D(); m_mode = sp::Window::WINDOWED; @@ -20,7 +20,7 @@ void DisplayExample::init() m_renderer->setCamera(m_camera); } -void DisplayExample::onEvent(const sp::Event& event) +void WindowExample::onEvent(const sp::Event& event) { if (event.type == sp::Event::Key && event.key.pressed == false) { @@ -51,12 +51,12 @@ void DisplayExample::onEvent(const sp::Event& event) } } -void DisplayExample::update(double dt) +void WindowExample::update(double dt) { // Nothing to do } -void DisplayExample::render() +void WindowExample::render() { sp::Graphics* g = getGraphics(); diff --git a/examples/display/DisplayExample.h b/examples/window/WindowExample.h similarity index 90% rename from examples/display/DisplayExample.h rename to examples/window/WindowExample.h index 7351124..b60aada 100644 --- a/examples/display/DisplayExample.h +++ b/examples/window/WindowExample.h @@ -8,7 +8,7 @@ #include #include -class DisplayExample : public sp::Game, sp::EventListener +class WindowExample : public sp::Game, sp::EventListener { public : void onEvent(const sp::Event& event); diff --git a/examples/window/main.cpp b/examples/window/main.cpp new file mode 100644 index 0000000..10a0fdf --- /dev/null +++ b/examples/window/main.cpp @@ -0,0 +1,11 @@ + +#include "WindowExample.h" + +int main(int argc, char **argv) { + + WindowExample game; + + game.run(); + + return 0; +}