This patch will make Mapbox GL Core never use OpenGL directly. We should consider locking into OpenGL ES 2.0 to simplify the code path and remove #ifdefs.
22 lines
666 B
C++
22 lines
666 B
C++
#include <mbgl/gl/vertex_array.hpp>
|
|
#include <mbgl/gl/context.hpp>
|
|
|
|
namespace mbgl {
|
|
namespace gl {
|
|
|
|
void VertexArray::bind(Context& context, BufferID indexBuffer, const AttributeBindingArray& bindings) {
|
|
context.bindVertexArray = state->vertexArray;
|
|
state->indexBuffer = indexBuffer;
|
|
|
|
state->bindings.reserve(bindings.size());
|
|
for (AttributeLocation location = 0; location < bindings.size(); ++location) {
|
|
if (state->bindings.size() <= location) {
|
|
state->bindings.emplace_back(context, AttributeLocation(location));
|
|
}
|
|
state->bindings[location] = bindings[location];
|
|
}
|
|
}
|
|
|
|
} // namespace gl
|
|
} // namespace mbgl
|