X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fframebuffer.h;h=2e29dbc3f440c7f1b9f1646e7dd611d39e977dc4;hb=f1b12c992db974c679d85ae6ec22cd318199d0d5;hp=e25967aca41ddfd6b29bfa6aae211e473e1807f2;hpb=fe5bf090db687ef1dd1084218156bcbc0b801081;p=libs%2Fgl.git diff --git a/source/framebuffer.h b/source/framebuffer.h index e25967ac..2e29dbc3 100644 --- a/source/framebuffer.h +++ b/source/framebuffer.h @@ -5,6 +5,7 @@ #include "bindable.h" #include "gl.h" #include "texturecube.h" +#include namespace Msp { namespace GL { @@ -39,8 +40,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 +97,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 +141,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