GLSL Shaders -> Files (instead of #define)
[ipdf/code.git] / src / framebuffer.h
1 #ifndef _FRAMEBUFFER_H
2 #define _FRAMEBUFFER_H
3
4 #include <SDL.h>
5 #include "gl_core44.h"
6
7
8 namespace IPDF
9 {
10         /*
11          * The "FrameBuffer" class represents an offscreen render target. 
12          */
13         class FrameBuffer
14         {
15         public:
16                 FrameBuffer() : m_render_texture(0), m_render_fbo(0), m_width(0), m_height(0) {}
17                 ~FrameBuffer() { Destroy(); }
18                 void Create(int w, int h);
19                 void Destroy();
20                 void Bind();
21                 void UnBind();
22                 void Blit();
23                 void Clear(float r=1.0, float g=1.0, float b=1.0, float a=1.0);
24                 int GetWidth() { return m_width; }
25                 int GetHeight() { return m_height; }
26         private:
27                 GLuint m_render_texture;
28                 GLuint m_render_fbo;
29                 int m_width;
30                 int m_height;
31         };
32
33 }
34
35 #endif // _SCREEN_H

UCC git Repository :: git.ucc.asn.au