#pragma once #include #include #include "3DRenderer.hpp" class UI { public: virtual ~UI() = 0; virtual void Update() = 0; virtual inline void Draw(std::shared_ptr c) { DrawUIOnRenderWindow(c); } protected: sf::RenderTexture mUIRender; // The screen to draw onto void DrawUIOnRenderWindow(std::shared_ptr context); }; inline UI::~UI() {} class CockpitUI final : public UI { public: CockpitUI(); ~CockpitUI() {} CockpitUI(CockpitUI&&) = default; CockpitUI& operator= (CockpitUI&&) = default; CockpitUI(CockpitUI const&) = delete; CockpitUI& operator= (CockpitUI const&) = delete; void Update() override; void Draw(std::shared_ptr) override; private: sf::Texture mStaticCockpitTexture; }; class WorldUI final : public UI { public: WorldUI(std::shared_ptr engineInstance); ~WorldUI() {} WorldUI(WorldUI&&) = default; WorldUI& operator= (WorldUI&&) = default; WorldUI(WorldUI const&) = delete; WorldUI& operator= (WorldUI const&) = delete; void Update() override; void Draw(std::shared_ptr) override; private: std::shared_ptr mWorld3D; };