blob: 1408add65aaf8b4195d48aa72d119715bf6d36d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
#pragma once
#include <mbgl/gl/types.hpp>
#include <unique_resource.hpp>
namespace mbgl {
namespace gl {
class Context;
namespace detail {
struct ProgramDeleter {
Context* context;
void operator()(ProgramID) const;
};
struct ShaderDeleter {
Context* context;
void operator()(ShaderID) const;
};
struct BufferDeleter {
Context* context;
void operator()(BufferID) const;
};
struct TextureDeleter {
Context* context;
void operator()(TextureID) const;
};
struct VertexArrayDeleter {
Context* context;
void operator()(VertexArrayID) const;
};
struct FramebufferDeleter {
Context* context;
void operator()(FramebufferID) const;
};
struct RenderbufferDeleter {
Context* context;
void operator()(RenderbufferID) const;
};
} // namespace detail
using UniqueProgram = std_experimental::unique_resource<ProgramID, detail::ProgramDeleter>;
using UniqueShader = std_experimental::unique_resource<ShaderID, detail::ShaderDeleter>;
using UniqueBuffer = std_experimental::unique_resource<BufferID, detail::BufferDeleter>;
using UniqueTexture = std_experimental::unique_resource<TextureID, detail::TextureDeleter>;
using UniqueVertexArray = std_experimental::unique_resource<VertexArrayID, detail::VertexArrayDeleter>;
using UniqueFramebuffer = std_experimental::unique_resource<FramebufferID, detail::FramebufferDeleter>;
using UniqueRenderbuffer = std_experimental::unique_resource<RenderbufferID, detail::RenderbufferDeleter>;
} // namespace gl
} // namespace mbgl
|