#pragma once #include "Shader.hpp" #include "../helpers/Box.hpp" #include "../helpers/Color.hpp" #include "Texture.hpp" #include #include #include #include struct SPreloadedAsset { CTexture texture; }; class CAsyncResourceGatherer { public: CAsyncResourceGatherer(); std::atomic ready = false; std::atomic applied = false; std::atomic progress = 0; SPreloadedAsset* getAssetByID(const std::string& id); void apply(); private: std::thread thread; enum eTargetType { TARGET_IMAGE = 0, }; struct SPreloadTarget { eTargetType type = TARGET_IMAGE; std::string id = ""; void* data; void* cairo; void* cairosurface; Vector2D size; }; std::vector preloadTargets; std::unordered_map assets; void gather(); };