Change float representations to be more IEEE-ish
[ipdf/code.git] / src / framebuffer.h
1 #ifndef _FRAMEBUFFER_H
2 #define _FRAMEBUFFER_H
3
4 #include <SDL.h>
5 #define GL_GLEXT_PROTOTYPES
6 #include <SDL_opengl.h>
7
8
9 namespace IPDF
10 {
11         /*
12          * The "Screen" class handles managing the OS window (using SDL2).
13          */
14         class FrameBuffer
15         {
16         public:
17                 FrameBuffer() : m_render_texture(0), m_render_fbo(0), m_width(0), m_height(0) {}
18                 ~FrameBuffer() { Destroy(); }
19                 void Create(int w, int h);
20                 void Destroy();
21                 void Bind();
22                 void UnBind();
23                 void Blit();
24                 void Clear(float r=1.0, float g=1.0, float b=1.0, float a=1.0);
25                 int GetWidth() { return m_width; }
26                 int GetHeight() { return m_height; }
27         private:
28                 GLuint m_render_texture;
29                 GLuint m_render_fbo;
30                 int m_width;
31                 int m_height;
32         };
33
34 }
35
36 #endif // _SCREEN_H

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