diff options
Diffstat (limited to 'platform/default/mbgl/gl/offscreen_view.hpp')
-rw-r--r-- | platform/default/mbgl/gl/offscreen_view.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/platform/default/mbgl/gl/offscreen_view.hpp b/platform/default/mbgl/gl/offscreen_view.hpp new file mode 100644 index 0000000000..0e839e14cc --- /dev/null +++ b/platform/default/mbgl/gl/offscreen_view.hpp @@ -0,0 +1,33 @@ +#pragma once + +#include <mbgl/map/view.hpp> +#include <mbgl/gl/framebuffer.hpp> +#include <mbgl/gl/renderbuffer.hpp> +#include <mbgl/util/optional.hpp> +#include <mbgl/util/image.hpp> + +namespace mbgl { + +namespace gl { +class Context; +} // namespace gl + +class OffscreenView : public View { +public: + OffscreenView(gl::Context&, Size size = { 256, 256 }); + + void bind() override; + + PremultipliedImage readStillImage(); + +public: + const Size size; + +private: + gl::Context& context; + optional<gl::Framebuffer> framebuffer; + optional<gl::Renderbuffer<gl::RenderbufferType::RGBA>> color; + optional<gl::Renderbuffer<gl::RenderbufferType::DepthStencil>> depthStencil; +}; + +} // namespace mbgl |