Using std future promises to get thumbnail of render view

This commit is contained in:
Bruno
2021-04-24 13:14:57 +02:00
parent 5473c0b38b
commit f643e80de7
4 changed files with 32 additions and 16 deletions

View File

@@ -1,6 +1,9 @@
#ifndef RENDERVIEW_H
#define RENDERVIEW_H
#include <mutex>
#include <future>
#include "View.h"
class RenderView : public View
@@ -8,6 +11,9 @@ class RenderView : public View
FrameBuffer *frame_buffer_;
Surface *fading_overlay_;
std::promise<FrameBufferImage *> thumbnail_;
std::future<FrameBufferImage *> thumbnailer_;
public:
RenderView ();
~RenderView ();
@@ -23,7 +29,7 @@ public:
inline FrameBuffer *frame () const { return frame_buffer_; }
FrameBufferImage *thumbnail () const;
FrameBufferImage *thumbnail ();
};
#endif // RENDERVIEW_H