diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-03-07 13:08:30 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-03-12 11:03:54 +0100 |
commit | cb64c380fbbd209cb68af60e76b7a770805353a8 (patch) | |
tree | 77b790ae49e8f5877be599a0dad2f413a98da43f /src/mbgl/gfx/texture.hpp | |
parent | 54847ea98698c85da156874dc84088772599ee3b (diff) | |
download | qtlocation-mapboxgl-cb64c380fbbd209cb68af60e76b7a770805353a8.tar.gz |
[core] add texture bindings to draw call invocations
Diffstat (limited to 'src/mbgl/gfx/texture.hpp')
-rw-r--r-- | src/mbgl/gfx/texture.hpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/mbgl/gfx/texture.hpp b/src/mbgl/gfx/texture.hpp index ca5ab5d5d5..bbda44a8fb 100644 --- a/src/mbgl/gfx/texture.hpp +++ b/src/mbgl/gfx/texture.hpp @@ -2,6 +2,8 @@ #include <mbgl/gfx/types.hpp> #include <mbgl/util/size.hpp> +#include <mbgl/util/type_list.hpp> +#include <mbgl/util/indexed_tuple.hpp> #include <memory> @@ -29,5 +31,38 @@ public: std::unique_ptr<const TextureResource> resource; }; +class TextureBinding { +public: + TextureBinding(const TextureResource& resource_, + TextureFilterType filter_ = TextureFilterType::Nearest, + TextureMipMapType mipmap_ = TextureMipMapType::No, + TextureWrapType wrapX_ = TextureWrapType::Clamp, + TextureWrapType wrapY_ = TextureWrapType::Clamp) + : resource(&resource_), filter(filter_), mipmap(mipmap_), wrapX(wrapX_), wrapY(wrapY_) { + } + + const TextureResource* resource; + TextureFilterType filter; + TextureMipMapType mipmap; + TextureWrapType wrapX; + TextureWrapType wrapY; +}; + +namespace detail { + +template <class> +class TextureBindings; + +template <class... Ts> +class TextureBindings<TypeList<Ts...>> { +public: + using Type = IndexedTuple<TypeList<Ts...>, TypeList<ExpandToType<Ts, TextureBinding>...>>; +}; + +} // namespace detail + +template <class TextureTypeList> +using TextureBindings = typename detail::TextureBindings<TextureTypeList>::Type; + } // namespace gfx } // namespace mbgl |