summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/types.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-10-02 17:43:51 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-10-05 10:52:19 -0700
commite4310aa87489c2db52d7ff65f71e51cc6c9700b6 (patch)
tree438e67108779aac6f8787ef7b03644534955bf1f /src/mbgl/gl/types.hpp
parentb9b8657d43aa1172e9ca6be162e915006806ee57 (diff)
downloadqtlocation-mapboxgl-e4310aa87489c2db52d7ff65f71e51cc6c9700b6.tar.gz
[core] Improve attribute binding API
Diffstat (limited to 'src/mbgl/gl/types.hpp')
-rw-r--r--src/mbgl/gl/types.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mbgl/gl/types.hpp b/src/mbgl/gl/types.hpp
index e9d14e4807..f24674457a 100644
--- a/src/mbgl/gl/types.hpp
+++ b/src/mbgl/gl/types.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <cstdint>
+#include <type_traits>
namespace mbgl {
namespace gl {
@@ -22,6 +23,26 @@ using DepthValue = double;
using StencilValue = int32_t;
using StencilMaskValue = uint32_t;
+enum class DataType : uint32_t {
+ Byte = 0x1400,
+ UnsignedByte = 0x1401,
+ Short = 0x1402,
+ UnsignedShort = 0x1403,
+ Integer = 0x1404,
+ UnsignedInteger = 0x1405,
+ Float = 0x1406
+};
+
+template <typename T> struct DataTypeOf;
+
+template <> struct DataTypeOf<int8_t> : std::integral_constant<DataType, DataType::Byte> {};
+template <> struct DataTypeOf<uint8_t> : std::integral_constant<DataType, DataType::UnsignedByte> {};
+template <> struct DataTypeOf<int16_t> : std::integral_constant<DataType, DataType::Short> {};
+template <> struct DataTypeOf<uint16_t> : std::integral_constant<DataType, DataType::UnsignedShort> {};
+template <> struct DataTypeOf<int32_t> : std::integral_constant<DataType, DataType::Integer> {};
+template <> struct DataTypeOf<uint32_t> : std::integral_constant<DataType, DataType::UnsignedInteger> {};
+template <> struct DataTypeOf<float> : std::integral_constant<DataType, DataType::Float> {};
+
enum class BufferType : uint32_t {
Vertex = 0x8892,
Element = 0x8893