summaryrefslogtreecommitdiff
path: root/src/mbgl/programs/attributes.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-10-28 18:17:33 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-11-08 08:09:29 -0800
commit66bdbc3b969083b9d647abdf72784be64a125949 (patch)
tree9f2f1c6eb3d0569926420459c2c9afda50c66fd0 /src/mbgl/programs/attributes.hpp
parent36210fe4e9c68a52dedc90548d90e77cf39a2228 (diff)
downloadqtlocation-mapboxgl-66bdbc3b969083b9d647abdf72784be64a125949.tar.gz
[core] Introduce gl::Program template
Diffstat (limited to 'src/mbgl/programs/attributes.hpp')
-rw-r--r--src/mbgl/programs/attributes.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mbgl/programs/attributes.hpp b/src/mbgl/programs/attributes.hpp
new file mode 100644
index 0000000000..38bbe89377
--- /dev/null
+++ b/src/mbgl/programs/attributes.hpp
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <mbgl/gl/attribute.hpp>
+
+#include <cstdint>
+
+namespace mbgl {
+namespace attributes {
+
+// Attributes common to several shaders.
+
+MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_pos);
+MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_offset);
+MBGL_DEFINE_ATTRIBUTE(int16_t, 2, a_extrude);
+MBGL_DEFINE_ATTRIBUTE(uint16_t, 2, a_texture_pos);
+
+template <std::size_t N>
+struct a_data : gl::Attribute<a_data<N>, uint8_t, N> {
+ static constexpr auto name = "a_data";
+};
+
+} // namespace attributes
+} // namespace mbgl