diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-04-01 13:48:20 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-04-05 11:49:17 +0200 |
commit | 865f8a6c03540e329ed6caef354799fb58b7ab6e (patch) | |
tree | 8c748a0ef16dc88ed0ceeadea71f20bfd99cdf96 /src/mbgl/gl/context.cpp | |
parent | ebd850803278a6ffbca0bc8a5b96d415b239aeb8 (diff) | |
download | qtlocation-mapboxgl-865f8a6c03540e329ed6caef354799fb58b7ab6e.tar.gz |
[core] add gfx::Renderable and gfx::OffscreenTexture
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r-- | src/mbgl/gl/context.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index f4e565c766..d33ae067f6 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -6,6 +6,7 @@ #include <mbgl/gl/renderbuffer_resource.hpp> #include <mbgl/gl/draw_scope_resource.hpp> #include <mbgl/gl/texture.hpp> +#include <mbgl/gl/offscreen_texture.hpp> #include <mbgl/gl/command_encoder.hpp> #include <mbgl/gl/debugging_extension.hpp> #include <mbgl/gl/vertex_array_extension.hpp> @@ -553,6 +554,17 @@ void Context::updateTextureResourceSub(gfx::TextureResource& resource, Enum<gfx::TextureChannelDataType>::to(type), data)); } +std::unique_ptr<gfx::OffscreenTexture> +Context::createOffscreenTexture(const Size size, const gfx::TextureChannelDataType type) { + return std::make_unique<gl::OffscreenTexture>(*this, size, type); +} + +std::unique_ptr<gfx::OffscreenTexture> +Context::createOffscreenTexture(const Size size, + gfx::Renderbuffer<gfx::RenderbufferPixelType::Depth>& depth, + gfx::TextureChannelDataType type) { + return std::make_unique<gl::OffscreenTexture>(*this, size, depth, type); +} std::unique_ptr<gfx::DrawScopeResource> Context::createDrawScopeResource() { return std::make_unique<gl::DrawScopeResource>(createVertexArray()); |