diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-03-06 10:38:58 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-03-06 16:12:51 +0100 |
commit | 8a8291d8f4ce39d341f42c6d14b2aaad28cd854e (patch) | |
tree | 14204115c7087ed4ccf6e38b40a84dea33575b00 /src/mbgl/gl/context.cpp | |
parent | ec42b2a5a409d767655a61228f951e1f37835d44 (diff) | |
download | qtlocation-mapboxgl-8a8291d8f4ce39d341f42c6d14b2aaad28cd854e.tar.gz |
[core] introduce gfx::Context and move Buffer creation/update methods to it
Diffstat (limited to 'src/mbgl/gl/context.cpp')
-rw-r--r-- | src/mbgl/gl/context.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/gl/context.cpp b/src/mbgl/gl/context.cpp index 514bc0115e..df304eb7d4 100644 --- a/src/mbgl/gl/context.cpp +++ b/src/mbgl/gl/context.cpp @@ -246,7 +246,7 @@ void Context::verifyProgramLinkage(ProgramID program_) { } std::unique_ptr<const gfx::VertexBufferResource> -Context::createVertexBuffer(const void* data, std::size_t size, const gfx::BufferUsageType usage) { +Context::createVertexBufferResource(const void* data, std::size_t size, const gfx::BufferUsageType usage) { BufferID id = 0; MBGL_CHECK_ERROR(glGenBuffers(1, &id)); UniqueBuffer result { std::move(id), { this } }; @@ -255,13 +255,13 @@ Context::createVertexBuffer(const void* data, std::size_t size, const gfx::Buffe return std::make_unique<gl::VertexBufferResource>(std::move(result)); } -void Context::updateVertexBuffer(const gfx::VertexBufferResource& resource, const void* data, std::size_t size) { +void Context::updateVertexBufferResource(const gfx::VertexBufferResource& resource, const void* data, std::size_t size) { vertexBuffer = reinterpret_cast<const gl::VertexBufferResource&>(resource).buffer; MBGL_CHECK_ERROR(glBufferSubData(GL_ARRAY_BUFFER, 0, size, data)); } std::unique_ptr<const gfx::IndexBufferResource> -Context::createIndexBuffer(const void* data, std::size_t size, const gfx::BufferUsageType usage) { +Context::createIndexBufferResource(const void* data, std::size_t size, const gfx::BufferUsageType usage) { BufferID id = 0; MBGL_CHECK_ERROR(glGenBuffers(1, &id)); UniqueBuffer result { std::move(id), { this } }; @@ -271,7 +271,7 @@ Context::createIndexBuffer(const void* data, std::size_t size, const gfx::Buffer return std::make_unique<gl::IndexBufferResource>(std::move(result)); } -void Context::updateIndexBuffer(const gfx::IndexBufferResource& resource, const void* data, std::size_t size) { +void Context::updateIndexBufferResource(const gfx::IndexBufferResource& resource, const void* data, std::size_t size) { // Be sure to unbind any existing vertex array object before binding the index buffer // so that we don't mess up another VAO bindVertexArray = 0; |