X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fframebuffer.h;h=ab91d9e7b0df08e4f2081d3b2becb18879c753bd;hb=b2c8b2238877f76cdea184cca70336b15ddb78d9;hp=e25967aca41ddfd6b29bfa6aae211e473e1807f2;hpb=fe5bf090db687ef1dd1084218156bcbc0b801081;p=libs%2Fgl.git diff --git a/source/framebuffer.h b/source/framebuffer.h index e25967ac..ab91d9e7 100644 --- a/source/framebuffer.h +++ b/source/framebuffer.h @@ -5,6 +5,8 @@ #include "bindable.h" #include "gl.h" #include "texturecube.h" +#include +#include namespace Msp { namespace GL { @@ -27,8 +29,8 @@ enum FramebufferStatus { FRAMEBUFFER_INCOMPLETE_ATTACHMENT = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT, FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT, - FRAMEBUFFER_INCOMPLETE_DIMENSIONS = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT, - FRAMEBUFFER_INCOMPLETE_FORMATS = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT, + FRAMEBUFFER_INCOMPLETE_DIMENSIONS = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS, + FRAMEBUFFER_INCOMPLETE_FORMATS = GL_FRAMEBUFFER_INCOMPLETE_FORMATS, FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER, FRAMEBUFFER_INCOMPLETE_READ_BUFFER = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER, FRAMEBUFFER_UNSUPPORTED = GL_FRAMEBUFFER_UNSUPPORTED, @@ -39,8 +41,7 @@ enum BufferBits { COLOR_BUFFER_BIT = GL_COLOR_BUFFER_BIT, DEPTH_BUFFER_BIT = GL_DEPTH_BUFFER_BIT, - STENCIL_BUFFER_BIT = GL_STENCIL_BUFFER_BIT, - ACCUM_BUFFER_BIT = GL_ACCUM_BUFFER_BIT + STENCIL_BUFFER_BIT = GL_STENCIL_BUFFER_BIT }; enum RWBuffer @@ -97,10 +98,21 @@ private: void clear(); }; + struct Viewport + { + int left; + int bottom; + unsigned width; + unsigned height; + + Viewport(); + }; + unsigned id; std::vector attachments; unsigned width; unsigned height; + Viewport view; mutable unsigned dirty; Framebuffer(unsigned); @@ -130,6 +142,9 @@ public: isn't. */ void require_complete() const; + void viewport(int, int, unsigned, unsigned); + void reset_viewport(); + void clear(BufferBits); /** Blits a region from another framebuffer into this one. If the source