summaryrefslogtreecommitdiff
path: root/src/mbgl/gfx
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-03-07 13:08:30 +0100
committerKonstantin Käfer <mail@kkaefer.com>2019-03-12 11:03:54 +0100
commitcb64c380fbbd209cb68af60e76b7a770805353a8 (patch)
tree77b790ae49e8f5877be599a0dad2f413a98da43f /src/mbgl/gfx
parent54847ea98698c85da156874dc84088772599ee3b (diff)
downloadqtlocation-mapboxgl-cb64c380fbbd209cb68af60e76b7a770805353a8.tar.gz
[core] add texture bindings to draw call invocations
Diffstat (limited to 'src/mbgl/gfx')
-rw-r--r--src/mbgl/gfx/texture.hpp35
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