summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/types.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gl/types.hpp')
-rw-r--r--src/mbgl/gl/types.hpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mbgl/gl/types.hpp b/src/mbgl/gl/types.hpp
index 74ce67fba6..da08195e58 100644
--- a/src/mbgl/gl/types.hpp
+++ b/src/mbgl/gl/types.hpp
@@ -15,8 +15,16 @@ using VertexArrayID = uint32_t;
using FramebufferID = uint32_t;
using RenderbufferID = uint32_t;
-using AttributeLocation = int32_t;
+// OpenGL does not formally define a type for attribute locations, but most APIs use
+// GLuint. The exception is glGetAttribLocation, which returns GLint so that -1 can
+// be used as an error indicator.
+using AttributeLocation = uint32_t;
+
+// OpenGL does not formally define a type for uniform locations, but all APIs use GLint.
+// The value -1 is special, typically used as a placeholder for an unused uniform and
+// "silently ignored".
using UniformLocation = int32_t;
+
using TextureUnit = uint8_t;
enum class ShaderType : uint32_t {
@@ -24,7 +32,7 @@ enum class ShaderType : uint32_t {
Fragment = 0x8B30
};
-enum class DataType : uint32_t {
+enum class DataType : uint16_t {
Byte = 0x1400,
UnsignedByte = 0x1401,
Short = 0x1402,
@@ -96,5 +104,11 @@ enum class UniformDataType : uint32_t {
SamplerCube = 0x8B60,
};
+enum class BufferUsage : uint32_t {
+ StreamDraw = 0x88E0,
+ StaticDraw = 0x88E4,
+ DynamicDraw = 0x88E8,
+};
+
} // namespace gl
} // namespace mbgl