summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-06-06 16:15:29 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-06-07 13:01:58 +0300
commit5e6f8d4ce5ad5c6ccb3e9a4525ec52a414e067a1 (patch)
tree181a987b024463cf8e49cebbb5c99d9548d9fcb3
parentb761aad4e62162bd17fbf639146a82281228318f (diff)
downloadqtlocation-mapboxgl-5e6f8d4ce5ad5c6ccb3e9a4525ec52a414e067a1.tar.gz
[core] Use initializer list for Unique* objects
-rw-r--r--src/mbgl/gl/object_store.hpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mbgl/gl/object_store.hpp b/src/mbgl/gl/object_store.hpp
index e430214013..3ae1b6e2fe 100644
--- a/src/mbgl/gl/object_store.hpp
+++ b/src/mbgl/gl/object_store.hpp
@@ -20,27 +20,27 @@ class ObjectStore;
struct ProgramDeleter {
ObjectStore* store;
- void operator()(GLuint id) const;
+ void operator()(GLuint) const;
};
struct ShaderDeleter {
ObjectStore* store;
- void operator()(GLuint id) const;
+ void operator()(GLuint) const;
};
struct BufferDeleter {
ObjectStore* store;
- void operator()(GLuint id) const;
+ void operator()(GLuint) const;
};
struct TextureDeleter {
ObjectStore* store;
- void operator()(GLuint id) const;
+ void operator()(GLuint) const;
};
struct VAODeleter {
ObjectStore* store;
- void operator()(GLuint id) const;
+ void operator()(GLuint) const;
};
using ObjectPool = std::array<GLuint, TextureMax>;
@@ -62,36 +62,36 @@ public:
~ObjectStore();
UniqueProgram createProgram() {
- return UniqueProgram(MBGL_CHECK_ERROR(glCreateProgram()), { this });
+ return UniqueProgram { MBGL_CHECK_ERROR(glCreateProgram()), { this } };
}
UniqueShader createShader(GLenum type) {
- return UniqueShader(MBGL_CHECK_ERROR(glCreateShader(type)), { this });
+ return UniqueShader { MBGL_CHECK_ERROR(glCreateShader(type)), { this } };
}
UniqueBuffer createBuffer() {
GLuint id = 0;
MBGL_CHECK_ERROR(glGenBuffers(1, &id));
- return UniqueBuffer(std::move(id), { this });
+ return UniqueBuffer { std::move(id), { this } };
}
UniqueTexture createTexture() {
GLuint id = 0;
MBGL_CHECK_ERROR(glGenTextures(1, &id));
- return UniqueTexture(std::move(id), { this });
+ return UniqueTexture { std::move(id), { this } };
}
UniqueVAO createVAO() {
GLuint id = 0;
MBGL_CHECK_ERROR(gl::GenVertexArrays(1, &id));
- return UniqueVAO(std::move(id), { this });
+ return UniqueVAO { std::move(id), { this } };
}
UniqueTexturePool createTexturePool() {
ObjectPool ids;
MBGL_CHECK_ERROR(glGenTextures(TextureMax, ids.data()));
assert(ids.size() == size_t(TextureMax));
- return UniqueTexturePool(std::move(ids), { this });
+ return UniqueTexturePool { std::move(ids), { this } };
}
// Actually remove the objects we marked as abandoned with the above methods.