diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/AsyncImageLoader.hpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/AsyncImageLoader.hpp b/include/AsyncImageLoader.hpp index fe8d52a..fa32971 100644 --- a/include/AsyncImageLoader.hpp +++ b/include/AsyncImageLoader.hpp @@ -4,7 +4,7 @@ #include <SFML/System/Vector2.hpp> #include <SFML/Graphics/Texture.hpp> #include <memory> -#include <future> +#include <thread> namespace QuickMedia { enum class LoadingState { @@ -23,15 +23,13 @@ namespace QuickMedia { class AsyncImageLoader { public: - ~AsyncImageLoader(); // Returns false if the image loader is already loading an image. In that case, this function should be called again later. // set |resize_target_size| to {0, 0} to disable resizing. // |thumbnail_data.loading_state| has to be LoadingState::NOT_LOADED when calling this! // Note: this method is not thread-safe bool load_thumbnail(const std::string &url, bool local, sf::Vector2i resize_target_size, bool use_tor, std::shared_ptr<ThumbnailData> thumbnail_data); - void update(); private: bool loading_image = false; - std::future<void> load_image_future; + std::thread load_image_thread; }; }
\ No newline at end of file |