summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/texture_pool.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gl/texture_pool.hpp')
-rw-r--r--src/mbgl/gl/texture_pool.hpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/mbgl/gl/texture_pool.hpp b/src/mbgl/gl/texture_pool.hpp
index 9ab7d14ef6..3c38343f62 100644
--- a/src/mbgl/gl/texture_pool.hpp
+++ b/src/mbgl/gl/texture_pool.hpp
@@ -4,20 +4,32 @@
#include <mbgl/gl/gl.hpp>
#include <mbgl/gl/object_store.hpp>
+#include <unique_resource.hpp>
+
#include <memory>
namespace mbgl {
namespace gl {
+class TexturePool;
+
+struct TextureReleaser {
+ TexturePool* pool;
+ void operator()(GLuint) const;
+};
+
+using SharedTexture = std_experimental::unique_resource<GLuint, TextureReleaser>;
+
class TexturePool : private util::noncopyable {
public:
TexturePool();
~TexturePool();
- GLuint getTextureID(gl::ObjectStore&);
- void releaseTextureID(GLuint&);
+ SharedTexture acquireTexture(gl::ObjectStore&);
private:
+ friend TextureReleaser;
+
class Impl;
const std::unique_ptr<Impl> impl;
};