diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-10-02 17:43:51 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-10-05 10:52:19 -0700 |
commit | e4310aa87489c2db52d7ff65f71e51cc6c9700b6 (patch) | |
tree | 438e67108779aac6f8787ef7b03644534955bf1f /src/mbgl/gl/context.cpp | |
parent | b9b8657d43aa1172e9ca6be162e915006806ee57 (diff) | |
download | qtlocation-mapboxgl-e4310aa87489c2db52d7ff65f71e51cc6c9700b6.tar.gz |
[core] Improve attribute binding API
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r-- | src/mbgl/gl/context.cpp | 10 |
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); |