X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fframebuffer.h;h=920cbd2abb7efff2da7bbb27105eee37bbdcb12e;hp=e3ec6fa0cd93ef071b2a1abbf622f7b9561bcca3;hb=888817a67a9d840be66b52811b01eb77f10ff3e6;hpb=45806117a53330b9f0c9c60310d79c56e960fd1f diff --git a/src/framebuffer.h b/src/framebuffer.h index e3ec6fa..920cbd2 100644 --- a/src/framebuffer.h +++ b/src/framebuffer.h @@ -1,15 +1,15 @@ #ifndef _FRAMEBUFFER_H #define _FRAMEBUFFER_H -#include -#define GL_GLEXT_PROTOTYPES -#include +#include "SDL.h" +#include "gl_core44.h" namespace IPDF { - /* - * The "Screen" class handles managing the OS window (using SDL2). + /** + * The "FrameBuffer" class represents an offscreen render target. + * FrameBuffer::Create needs to be called to initialise it; constructor is trivial */ class FrameBuffer { @@ -18,9 +18,9 @@ namespace IPDF ~FrameBuffer() { Destroy(); } void Create(int w, int h); void Destroy(); - void Bind(); - void UnBind(); - void Blit(); + void Bind(); // set as render target + void UnBind(); // set render target to screen + void Blit(); // blit this FrameBuffer to current render target 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; }