diff options
Diffstat (limited to 'src/mbgl/gl/context.hpp')
-rw-r--r-- | src/mbgl/gl/context.hpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/mbgl/gl/context.hpp b/src/mbgl/gl/context.hpp index cf8bb2658b..6daf3f9bfb 100644 --- a/src/mbgl/gl/context.hpp +++ b/src/mbgl/gl/context.hpp @@ -49,10 +49,10 @@ public: } template <RenderbufferType type> - Renderbuffer<type> createRenderbuffer(const std::array<uint16_t, 2>& size) { + Renderbuffer<type> createRenderbuffer(const Size size) { static_assert(type == RenderbufferType::RGBA || type == RenderbufferType::DepthStencil, "invalid renderbuffer type"); - return { size, createRenderbuffer(type, size[0], size[1]) }; + return { size, createRenderbuffer(type, size) }; } Framebuffer createFramebuffer(const Renderbuffer<RenderbufferType::RGBA>&, @@ -65,13 +65,12 @@ public: // Create a texture from an image with data. template <typename Image> Texture createTexture(const Image& image, TextureUnit unit = 0) { - return { {{ image.width, image.height }}, - createTexture(image.width, image.height, image.data.get(), unit) }; + return { image.size, createTexture(image.size, image.data.get(), unit) }; } // Creates an empty texture with the specified dimensions. - Texture createTexture(const std::array<uint16_t, 2>& size, TextureUnit unit = 0) { - return { size, createTexture(size[0], size[1], nullptr, unit) }; + Texture createTexture(const Size size, TextureUnit unit = 0) { + return { size, createTexture(size, nullptr, unit) }; } void bindTexture(Texture&, @@ -140,9 +139,9 @@ public: private: UniqueBuffer createVertexBuffer(const void* data, std::size_t size); UniqueBuffer createIndexBuffer(const void* data, std::size_t size); - UniqueTexture createTexture(uint16_t width, uint16_t height, const void* data, TextureUnit); + UniqueTexture createTexture(Size size, const void* data, TextureUnit); UniqueFramebuffer createFramebuffer(); - UniqueRenderbuffer createRenderbuffer(RenderbufferType, uint16_t width, uint16_t height); + UniqueRenderbuffer createRenderbuffer(RenderbufferType, Size size); void bindAttribute(const AttributeBinding&, std::size_t stride, const int8_t* offset); friend detail::ProgramDeleter; |