summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/context.cpp
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/context.cpp
parentb9b8657d43aa1172e9ca6be162e915006806ee57 (diff)
downloadqtlocation-mapboxgl-e4310aa87489c2db52d7ff65f71e51cc6c9700b6.tar.gz
[core] Improve attribute binding API
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r--src/mbgl/gl/context.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp
index 5837aa3399..2a04fcc18e 100644
--- a/src/mbgl/gl/context.cpp
+++ b/src/mbgl/gl/context.cpp
@@ -109,6 +109,16 @@ UniqueBuffer Context::createIndexBuffer(const void* data, std::size_t size) {
return result;
}
+void Context::bindAttribute(const AttributeBinding& binding, std::size_t stride, const int8_t* offset) {
+ MBGL_CHECK_ERROR(glEnableVertexAttribArray(binding.location));
+ MBGL_CHECK_ERROR(glVertexAttribPointer(binding.location,
+ binding.count,
+ static_cast<GLenum>(binding.type),
+ false,
+ static_cast<GLsizei>(stride),
+ offset + binding.offset));
+}
+
UniqueTexture Context::createTexture() {
if (pooledTextures.empty()) {
pooledTextures.resize(TextureMax);