summaryrefslogtreecommitdiff
path: root/src/mbgl/util/ignore.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-11-07 12:26:05 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-11-08 08:09:29 -0800
commit1db2ffbc1b69069eca39f786cacc45dbb02c3052 (patch)
tree9d6ed2a7302492f41c52ea3fdeadabf6466b0d8d /src/mbgl/util/ignore.hpp
parent66bdbc3b969083b9d647abdf72784be64a125949 (diff)
downloadqtlocation-mapboxgl-1db2ffbc1b69069eca39f786cacc45dbb02c3052.tar.gz
[core] Use gl::Program to resolve some rough edges in the GL binding types
* Extract `ignore` util to separate header. * `Segment` now tracks offset and length of indices, rather than primitives. This is more natural. * Introduce `VertexVector` and `IndexVector` types. These types carry information about the intended draw mode (`Triangles`, `LineStrip`, etc.), and ensure that elements are always appended in a group size appropriate for that draw mode, for both indexed and unindexed rendering. * `Program`, rather than `Drawable`, is now the unifying object for draw calls. `Program` is the best place to type check the draw call, because it is typed to carry information about the intended primitive, vertex type, attributes, and uniforms. * Use the debug shaders for debug tile rendering, like gl-js. * Fix the draw mode for background. It was drawing triangle strips with a triangles array. Surprised this didn’t cause issues. Now it’s type checked.
Diffstat (limited to 'src/mbgl/util/ignore.hpp')
-rw-r--r--src/mbgl/util/ignore.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mbgl/util/ignore.hpp b/src/mbgl/util/ignore.hpp
new file mode 100644
index 0000000000..31cd092c0e
--- /dev/null
+++ b/src/mbgl/util/ignore.hpp
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <initializer_list>
+
+namespace mbgl {
+
+// Accept any number of parameters of any types, and do nothing with them.
+// Useful for providing a context for parameter pack expansion where a legal
+// expansion context is not otherwise available.
+//
+// See https://github.com/mapbox/cpp/blob/master/C%2B%2B%20Structural%20Metaprogramming.md
+// for more details.
+//
+template <class... Ts> void ignore(Ts&&...) {}
+
+// std::initializer_list overload, for situations where you need sequenced
+// modifications.
+//
+template <class T> void ignore(const std::initializer_list<T>&) {}
+
+} // namespace mbgl