From b33dff4c1d7c4629f39cb19034be073c616cbad3 Mon Sep 17 00:00:00 2001 From: jwendt <wendt@vr.rwth-aachen.de> Date: Thu, 19 Jul 2018 17:29:10 +0200 Subject: [PATCH] correct compiler problems #463 --- library/phx/display/display_system_window.hpp | 4 ++++ library/phx/input/device.hpp | 1 + library/phx/input/sdl_device.hpp | 1 + library/phx/input/tracked_device.hpp | 1 + tests/src/test_engine.cpp | 12 ++++++------ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/library/phx/display/display_system_window.hpp b/library/phx/display/display_system_window.hpp index 385f6d8d..09d2587a 100644 --- a/library/phx/display/display_system_window.hpp +++ b/library/phx/display/display_system_window.hpp @@ -70,6 +70,10 @@ class PHOENIX_EXPORT DisplaySystemWindow : public DisplaySystem { void OnSDLEvent(const SDL_Event& event) override; boost::signals2::signal<void()> quit_signal_; }; + // DisplaySystemWindow never calls Update on sdl_event_receiver, so if no + // other SDLDevice like Mouse or Keyboard is present the quit signal is never + // fired. The rational behind that is that the SDL Events are only polled from + // within the DeviceSystem SDLEventReceiver sdl_event_receiver; }; diff --git a/library/phx/input/device.hpp b/library/phx/input/device.hpp index 995d210a..ffe52baa 100644 --- a/library/phx/input/device.hpp +++ b/library/phx/input/device.hpp @@ -36,6 +36,7 @@ class PHOENIX_EXPORT Device { class EventDistributer { public: + virtual ~EventDistributer() = default; virtual void Update() = 0; void AddDevice(Device* device); void RemoveDevice(Device* device); diff --git a/library/phx/input/sdl_device.hpp b/library/phx/input/sdl_device.hpp index 30e1947e..6149a9a2 100644 --- a/library/phx/input/sdl_device.hpp +++ b/library/phx/input/sdl_device.hpp @@ -49,6 +49,7 @@ class PHOENIX_EXPORT SDLDevice : public Device { protected: class SDLEventDistributer : public EventDistributer { public: + virtual ~SDLEventDistributer() = default; void Update() override; }; static SDLEventDistributer SDL_event_distributer; diff --git a/library/phx/input/tracked_device.hpp b/library/phx/input/tracked_device.hpp index a6ee0bb9..7005d5f0 100644 --- a/library/phx/input/tracked_device.hpp +++ b/library/phx/input/tracked_device.hpp @@ -56,6 +56,7 @@ class PHOENIX_EXPORT TrackedDevice : public Device { protected: class OpenVREventDistributer : public EventDistributer { public: + virtual ~OpenVREventDistributer() = default; void Update() override; }; static OpenVREventDistributer vr_event_distributer; diff --git a/tests/src/test_engine.cpp b/tests/src/test_engine.cpp index e500e5b1..2d65f307 100644 --- a/tests/src/test_engine.cpp +++ b/tests/src/test_engine.cpp @@ -32,7 +32,7 @@ #include "phx/core/logger.hpp" #include "phx/core/system.hpp" #include "phx/display/display_system_window.hpp" -#include "phx/input/input_system.hpp" +#include "phx/input/device_system.hpp" #include "phx/rendering/rendering_system.hpp" #include "phx/scripting/behavior.hpp" #include "phx/setup.hpp" @@ -338,11 +338,11 @@ SCENARIO("An engine can be setup by the default setup", "[phx][phx::Engine]") { REQUIRE(rendering_system != nullptr); REQUIRE(rendering_system->GetEngine() == engine.get()); } - THEN("It has an input system") { - phx::InputSystem* input_system = - engine->GetSystem<phx::InputSystem>(); - REQUIRE(input_system != nullptr); - REQUIRE(input_system->GetEngine() == engine.get()); + THEN("It has a device system") { + phx::DeviceSystem* device_system = + engine->GetSystem<phx::DeviceSystem>(); + REQUIRE(device_system != nullptr); + REQUIRE(device_system->GetEngine() == engine.get()); } THEN("A default empty scene has been created") { REQUIRE(engine->GetScene() != nullptr); -- GitLab