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

New display system complete.

parent fccf6afd
No related branches found
No related tags found
1 merge request!121WIP: Feature/#388 reworked framegraph
......@@ -22,8 +22,17 @@
#include "display_system.hpp"
#include <vector>
namespace phx {
DisplaySystem::DisplaySystem(Engine* engine) : System(engine) {}
DisplaySystem::~DisplaySystem() {}
void DisplaySystem::Update(const FrameTimer::TimeInfo&) { tick(); }
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
......@@ -23,32 +23,22 @@
#ifndef 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 "phx/engine.hpp"
#include "phx/export.hpp"
#include "phx/render_target.hpp"
#include "phx/system.hpp"
namespace phx {
class PHOENIX_EXPORT DisplaySystem : public System {
class PHOENIX_EXPORT DisplaySystem : public System, public di::display_system {
public:
DisplaySystem(const DisplaySystem&) = delete;
DisplaySystem(DisplaySystem&&) = default;
~DisplaySystem();
DisplaySystem& operator=(const DisplaySystem&) = delete;
DisplaySystem& operator=(DisplaySystem&&) = default;
void Update(const FrameTimer::TimeInfo&) override;
void Update(const FrameTimer::TimeInfo&) override = 0;
protected:
explicit DisplaySystem(Engine* engine);
friend DisplaySystem* Engine::CreateSystem<DisplaySystem>();
std::vector<di::opengl_window*> OpenGLWindows() const;
};
} // namespace phx
#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