[core] Modern C++ bindings for OpenGL

This commit is contained in:
John Firebaugh
2016-09-26 12:53:32 -07:00
parent a4c82b8a3b
commit 0e57d10d77
97 changed files with 2233 additions and 1857 deletions

View File

@@ -2,7 +2,6 @@
#include <mbgl/style/layers/raster_layer.hpp>
#include <mbgl/shader/raster_shader.hpp>
#include <mbgl/renderer/painter.hpp>
#include <mbgl/gl/gl.hpp>
#include <mbgl/gl/context.hpp>
namespace mbgl {
@@ -25,23 +24,8 @@ void RasterBucket::render(Painter& painter,
painter.renderRaster(parameters, *this, *layer.as<RasterLayer>(), tile);
}
void RasterBucket::drawRaster(RasterShader& shader,
gl::VertexBuffer<RasterVertex>& vertices,
gl::VertexArrayObject& array,
gl::Context& context) {
assert(texture);
context.bindTexture(*texture, 0, gl::TextureFilter::Linear);
context.bindTexture(*texture, 1, gl::TextureFilter::Linear);
array.bind(shader, vertices, BUFFER_OFFSET_0, context);
MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, static_cast<GLsizei>(vertices.vertexCount)));
}
bool RasterBucket::hasData() const {
return true;
}
bool RasterBucket::needsClipping() const {
return false;
}
} // namespace mbgl