[core] GLObjectStore now uses GLuint

This commit is contained in:
Bruno de Oliveira Abinader
2015-09-10 15:33:32 +03:00
committed by Konstantin Käfer
parent b2fcde5e8b
commit 05d01194b7
2 changed files with 10 additions and 9 deletions

View File

@@ -7,17 +7,17 @@
namespace mbgl {
namespace util {
void GLObjectStore::abandonVAO(uint32_t vao) {
void GLObjectStore::abandonVAO(GLuint vao) {
assert(ThreadContext::currentlyOn(ThreadType::Map));
abandonedVAOs.emplace_back(vao);
}
void GLObjectStore::abandonBuffer(uint32_t buffer) {
void GLObjectStore::abandonBuffer(GLuint buffer) {
assert(ThreadContext::currentlyOn(ThreadType::Map));
abandonedBuffers.emplace_back(buffer);
}
void GLObjectStore::abandonTexture(uint32_t texture) {
void GLObjectStore::abandonTexture(GLuint texture) {
assert(ThreadContext::currentlyOn(ThreadType::Map));
abandonedTextures.emplace_back(texture);
}

View File

@@ -1,6 +1,7 @@
#ifndef MBGL_MAP_UTIL_GL_OBJECT_STORE
#define MBGL_MAP_UTIL_GL_OBJECT_STORE
#include <mbgl/platform/gl.hpp>
#include <mbgl/util/noncopyable.hpp>
#include <cstdint>
@@ -14,18 +15,18 @@ public:
GLObjectStore() = default;
// Mark OpenGL objects for deletion
void abandonVAO(uint32_t vao);
void abandonBuffer(uint32_t buffer);
void abandonTexture(uint32_t texture);
void abandonVAO(GLuint vao);
void abandonBuffer(GLuint buffer);
void abandonTexture(GLuint texture);
// Actually remove the objects we marked as abandoned with the above methods.
// Only call this while the OpenGL context is exclusive to this thread.
void performCleanup();
private:
std::vector<uint32_t> abandonedVAOs;
std::vector<uint32_t> abandonedBuffers;
std::vector<uint32_t> abandonedTextures;
std::vector<GLuint> abandonedVAOs;
std::vector<GLuint> abandonedBuffers;
std::vector<GLuint> abandonedTextures;
};
}