]> git.tdb.fi Git - libs/gl.git/blob - source/backends/opengl/texture_backend.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / backends / opengl / texture_backend.h
1 #ifndef MSP_GL_TEXTURE_BACKEND_H_
2 #define MSP_GL_TEXTURE_BACKEND_H_
3
4 #include <msp/core/noncopyable.h>
5
6 namespace Msp {
7 namespace GL {
8
9 class OpenGLTexture: public NonCopyable
10 {
11         friend class OpenGLFramebuffer;
12         friend class OpenGLPipelineState;
13
14 protected:
15         unsigned id = 0;
16         unsigned target;
17         std::string debug_name;
18
19         OpenGLTexture(unsigned);
20         OpenGLTexture(OpenGLTexture &&);
21         ~OpenGLTexture();
22
23         void create();
24         void require_swizzle();
25         void apply_swizzle();
26         void set_parameter_i(unsigned, int) const;
27
28         void generate_mipmap();
29
30         void set_debug_name(const std::string &);
31
32         void bind_scratch();
33         static void unbind_scratch();
34 };
35
36 using TextureBackend = OpenGLTexture;
37
38 } // namespace GL
39 } // namespace Msp
40
41 #endif