summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry/buffer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/geometry/buffer.hpp')
-rw-r--r--src/mbgl/geometry/buffer.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/geometry/buffer.hpp b/src/mbgl/geometry/buffer.hpp
index e8e2788f51..80fde61702 100644
--- a/src/mbgl/geometry/buffer.hpp
+++ b/src/mbgl/geometry/buffer.hpp
@@ -36,7 +36,7 @@ public:
// Transfers this buffer to the GPU and binds the buffer to the GL context.
void bind(gl::GLObjectStore& glObjectStore) {
- if (buffer) {
+ if (buffer.created()) {
MBGL_CHECK_ERROR(glBindBuffer(bufferType, getID()));
} else {
buffer.create(glObjectStore);
@@ -65,7 +65,7 @@ public:
// Uploads the buffer to the GPU to be available when we need it.
inline void upload(gl::GLObjectStore& glObjectStore) {
- if (!buffer) {
+ if (!buffer.created()) {
bind(glObjectStore);
}
}
@@ -73,7 +73,7 @@ public:
protected:
// increase the buffer size by at least /required/ bytes.
inline void *addElement() {
- if (buffer) {
+ if (buffer.created()) {
throw std::runtime_error("Can't add elements after buffer was bound to GPU");
}
if (length < pos + itemSize) {