diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-08-05 22:25:52 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2019-08-05 22:25:55 +0200 |
commit | 7ce2139650012d4c571c7e7600924853ab7032bb (patch) | |
tree | 0416c35ebc00f2c0ee8c255cc7bc602ae3c47dd3 /include | |
parent | c8cf957773260fb3af7cc013e2002db6bf982054 (diff) |
Load thumbnails in separate thread
Diffstat (limited to 'include')
-rw-r--r-- | include/Body.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/Body.hpp b/include/Body.hpp index c27ecf0..e09017d 100644 --- a/include/Body.hpp +++ b/include/Body.hpp @@ -4,6 +4,7 @@ #include <SFML/Graphics/Text.hpp> #include <SFML/Graphics/Texture.hpp> #include <SFML/Graphics/RenderWindow.hpp> +#include <thread> namespace QuickMedia { class BodyItem { @@ -43,6 +44,10 @@ namespace QuickMedia { sf::Text title_text; int selected_item; std::vector<std::unique_ptr<BodyItem>> items; - std::vector<std::unique_ptr<sf::Texture>> item_thumbnail_textures; + std::vector<std::shared_ptr<sf::Texture>> item_thumbnail_textures; + std::thread thumbnail_load_thread; + private: + std::shared_ptr<sf::Texture> load_thumbnail_from_url(const std::string &url); + bool loading_thumbnail; }; }
\ No newline at end of file |