X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fframebuffer.h;fp=src%2Fframebuffer.h;h=e3ec6fa0cd93ef071b2a1abbf622f7b9561bcca3;hp=0000000000000000000000000000000000000000;hb=45806117a53330b9f0c9c60310d79c56e960fd1f;hpb=f5263ffb797938b07eec50ea1e7fb54a2a8d47c7;ds=sidebyside diff --git a/src/framebuffer.h b/src/framebuffer.h new file mode 100644 index 0000000..e3ec6fa --- /dev/null +++ b/src/framebuffer.h @@ -0,0 +1,36 @@ +#ifndef _FRAMEBUFFER_H +#define _FRAMEBUFFER_H + +#include +#define GL_GLEXT_PROTOTYPES +#include + + +namespace IPDF +{ + /* + * The "Screen" class handles managing the OS window (using SDL2). + */ + class FrameBuffer + { + public: + FrameBuffer() : m_render_texture(0), m_render_fbo(0), m_width(0), m_height(0) {} + ~FrameBuffer() { Destroy(); } + void Create(int w, int h); + void Destroy(); + void Bind(); + void UnBind(); + void Blit(); + void Clear(float r=1.0, float g=1.0, float b=1.0, float a=1.0); + int GetWidth() { return m_width; } + int GetHeight() { return m_height; } + private: + GLuint m_render_texture; + GLuint m_render_fbo; + int m_width; + int m_height; + }; + +} + +#endif // _SCREEN_H