gramods
OffscreenRenderTargets.hh
1 
2 #ifndef GRAMODS_GRAPHICS_OFFSCREENRENDERTARGETS
3 #define GRAMODS_GRAPHICS_OFFSCREENRENDERTARGETS
4 
5 #include <gmGraphics/config.hh>
6 #include <gmCore/io_size.hh>
7 
8 #include <GL/glew.h>
9 #include <GL/gl.h>
10 
11 #include <memory>
12 
13 BEGIN_NAMESPACE_GMGRAPHICS;
14 
21 
22 public:
23 
25  virtual ~OffscreenRenderTargets();
26 
32  void setUsePowersOfTwo(bool on);
33 
39  bool getUsePowersOfTwo();
40 
45  void setLinearInterpolation(bool on);
46 
51  void setPixelFormat(GLenum format);
52 
56  GLenum getPixelFormat();
57 
64  void getTextureSize(size_t &width, size_t &height, size_t idx = 0);
65 
73  bool init(size_t count = 1);
74 
78  void push();
79 
84  void pop();
85 
90  void bind(gmCore::size2 res, size_t idx = 0);
91 
96  void bind(size_t width = 0, size_t height = 0, size_t idx = 0);
97 
101  GLuint getTexId(size_t idx = 0);
102 
103 private:
104 
105  struct Impl;
106  std::unique_ptr<Impl> _impl;
107 
108 };
109 
110 END_NAMESPACE_GMGRAPHICS;
111 
112 #endif
Encapsulation of OpenGL offscreen render target textures.
Definition: OffscreenRenderTargets.hh:20
std::array< size_t, 2 > size2
Array of 2 size_t.
Definition: io_size.hh:9
Definition: OffscreenRenderTargets.cpp:12