aboutsummaryrefslogtreecommitdiff
path: root/include/Cache.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-04-22 05:58:44 +0200
committerdec05eba <dec05eba@protonmail.com>2018-04-22 05:59:18 +0200
commit1e0e68f9cda51c881b32a54d9eece71c1428f7ac (patch)
treeb8faa1d971c245e3fcf046aa1d2daa1fa601e0f9 /include/Cache.hpp
parent424b02609fa34175a4e2aadb95e68b3c9c8dc93c (diff)
Add video and gif support
Gif streams from url. Todo: Add play controls to video
Diffstat (limited to 'include/Cache.hpp')
-rw-r--r--include/Cache.hpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/Cache.hpp b/include/Cache.hpp
index 59d997a..0314e7e 100644
--- a/include/Cache.hpp
+++ b/include/Cache.hpp
@@ -14,6 +14,8 @@ namespace TinyProcessLib
namespace dchat
{
+ class Gif;
+
struct ImageByUrlResult
{
enum class Type
@@ -23,9 +25,19 @@ namespace dchat
FAILED_DOWNLOAD
};
+ ImageByUrlResult() : texture(nullptr), type(Type::DOWNLOADING), isGif(false) {}
+ ImageByUrlResult(sf::Texture *_texture, Type _type) : texture(_texture), type(_type), isGif(false) {}
+ ImageByUrlResult(Gif *_gif, Type _type) : gif(_gif), type(_type), isGif(true) {}
+
// @texture is null if @type is DOWNLOADING or FAILED_DOWNLOAD
- sf::Texture *texture;
+ union
+ {
+ sf::Texture *texture;
+ Gif *gif;
+ };
+
Type type;
+ bool isGif;
};
class Cache