summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-07-10 12:25:03 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-07-12 14:55:02 -0700
commit2691fe165d06e0cc015b28a52815e1b024472a97 (patch)
tree9481579a4a07bb8b3815aee3259c2adcda938337
parent4c42132183f81bd9263f8513b1fa9f610035ed57 (diff)
downloadqtlocation-mapboxgl-2691fe165d06e0cc015b28a52815e1b024472a97.tar.gz
[core] Add comments explaining typing of AttributeLocation and UniformLocation
-rw-r--r--src/mbgl/gl/types.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mbgl/gl/types.hpp b/src/mbgl/gl/types.hpp
index 452c882ac9..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;
+// 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 {