#pragma once #include #include #include "../core/LockSurface.hpp" #include "Shader.hpp" #include "../helpers/Box.hpp" #include "../helpers/Color.hpp" #include "AsyncResourceGatherer.hpp" #include "widgets/IWidget.hpp" typedef std::unordered_map>> widgetMap_t; class CRenderer { public: CRenderer(); struct SRenderFeedback { bool needsFrame = false; }; SRenderFeedback renderLock(const CSessionLockSurface& surface); void renderRect(const CBox& box, const CColor& col, int rounding = 0); void renderTexture(const CBox& box, const CTexture& tex, float a = 1.0, int rounding = 0); std::unique_ptr asyncResourceGatherer; std::chrono::system_clock::time_point gatheredAt; private: widgetMap_t widgets; std::vector>* getOrCreateWidgetsFor(const CSessionLockSurface* surf); CShader rectShader; CShader texShader; std::array projMatrix; std::array projection; }; inline std::unique_ptr g_pRenderer;