First cut at Drawable fundamentals (#983)

Co-authored-by: mwilsnd <mwilsnd@gmail.com>
Co-authored-by: Alex Cristici <alex.cristici@gmail.com>
This commit is contained in:
Tim Sylvester
2023-04-17 09:58:57 -07:00
committed by Bart Louwers
parent 42afe4189c
commit 14b53e54ec
60 changed files with 1904 additions and 87 deletions

View File

@@ -0,0 +1,42 @@
#include <mbgl/gl/drawable_gl.hpp>
#include <mbgl/gl/drawable_gl_impl.hpp>
namespace mbgl {
namespace gl {
DrawableGL::DrawableGL()
: impl(std::make_unique<Impl>()) {
}
DrawableGL::~DrawableGL() {
}
void DrawableGL::draw(const PaintParameters &parameters) const
{
impl->draw(parameters);
}
void DrawableGL::setVertData(std::vector<std::uint8_t> vertexData_,
std::vector<std::uint16_t> indexes_) {
impl->vertData = std::move(vertexData_);
impl->indexes = std::move(indexes_);
}
std::vector<std::uint16_t>& DrawableGL::getIndexData() const {
return impl->indexes;
}
const gl::VertexArray& DrawableGL::getVertexArray() const {
return impl->vertexArray;
}
void DrawableGL::setVertexArray(gl::VertexArray&& vertexArray_,
gfx::UniqueVertexBufferResource&& attributeBuffer_,
gfx::IndexBuffer&& indexBuffer_) {
impl->vertexArray = std::move(vertexArray_);
impl->attributeBuffer = std::move(attributeBuffer_);
impl->indexBuffer = std::move(indexBuffer_);
}
} // namespace gl
} // namespace mbgl