Skip to content
Snippets Groups Projects
Commit 2d99fa59 authored by demiralp's avatar demiralp
Browse files

New display system complete.

parent fccf6afd
Branches
No related tags found
1 merge request!121WIP: Feature/#388 reworked framegraph
This commit is part of merge request !121. Comments created here will be created in the context of that merge request.
...@@ -22,8 +22,17 @@ ...@@ -22,8 +22,17 @@
#include "display_system.hpp" #include "display_system.hpp"
#include <vector>
namespace phx { namespace phx {
DisplaySystem::DisplaySystem(Engine* engine) : System(engine) {} void DisplaySystem::Update(const FrameTimer::TimeInfo&) { tick(); }
DisplaySystem::~DisplaySystem() {}
std::vector<di::opengl_window*> DisplaySystem::OpenGLWindows() const {
std::vector<di::opengl_window*> opengl_windows;
for (auto window : windows()) {
auto opengl_window = dynamic_cast<di::opengl_window*>(window);
if (opengl_window) opengl_windows.push_back(opengl_window);
}
return opengl_windows;
}
} // namespace phx } // namespace phx
...@@ -23,32 +23,22 @@ ...@@ -23,32 +23,22 @@
#ifndef LIBRARY_PHX_DISPLAY_SYSTEM_HPP_ #ifndef LIBRARY_PHX_DISPLAY_SYSTEM_HPP_
#define LIBRARY_PHX_DISPLAY_SYSTEM_HPP_ #define LIBRARY_PHX_DISPLAY_SYSTEM_HPP_
#include <memory> #include <di/systems/display/display_system.hpp>
#include <di/systems/display/opengl_window.hpp>
#include <vector> #include <vector>
#include "phx/engine.hpp" #include "phx/engine.hpp"
#include "phx/export.hpp" #include "phx/export.hpp"
#include "phx/render_target.hpp"
#include "phx/system.hpp" #include "phx/system.hpp"
namespace phx { namespace phx {
class PHOENIX_EXPORT DisplaySystem : public System, public di::display_system {
class PHOENIX_EXPORT DisplaySystem : public System {
public: public:
DisplaySystem(const DisplaySystem&) = delete; void Update(const FrameTimer::TimeInfo&) override;
DisplaySystem(DisplaySystem&&) = default;
~DisplaySystem();
DisplaySystem& operator=(const DisplaySystem&) = delete;
DisplaySystem& operator=(DisplaySystem&&) = default;
void Update(const FrameTimer::TimeInfo&) override = 0; std::vector<di::opengl_window*> OpenGLWindows() const;
protected:
explicit DisplaySystem(Engine* engine);
friend DisplaySystem* Engine::CreateSystem<DisplaySystem>();
}; };
} // namespace phx } // namespace phx
#endif // LIBRARY_PHX_DISPLAY_SYSTEM_HPP_ #endif // LIBRARY_PHX_DISPLAY_SYSTEM_HPP_
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment