12 #ifndef FRAMEBUFFER_H_6014714286 13 #define FRAMEBUFFER_H_6014714286 19 #include <Carna/Carna.h> 61 const static unsigned int MAXIMUM_ALLOWED_COLOR_COMPONENTS = 8;
76 static Texture< 2 >* createRenderTexture(
bool floatingPoint =
false );
86 bool hasRenderTexture(
unsigned int location )
const;
92 const Texture< 2 >& renderTexture(
unsigned int location )
const;
97 const unsigned int id;
104 static void copyDepthAttachment(
unsigned int srcId,
unsigned int dstId,
const Viewport& src,
const Viewport& dst );
112 static void copyColorAttachment
113 (
unsigned int srcId,
unsigned int dstId
115 ,
unsigned int srcColorAttachment,
unsigned int dstColorAttachment );
121 static unsigned int currentId();
130 void resize(
unsigned int width,
unsigned int height );
188 void setColorComponent(
Texture< 2 >& renderTexture,
unsigned int location = 0 );
195 void removeColorComponent(
unsigned int location );
203 Color readPixel(
unsigned int x,
unsigned int y,
unsigned int location = 0 )
const;
217 virtual void refresh()
const;
224 void bindFBO()
const;
263 virtual void refresh();
271 Texture< 2 >* renderTextures[ MAXIMUM_ALLOWED_COLOR_COMPONENTS ];
272 const unsigned int depthBuffer;
273 std::set< unsigned int > boundColorBuffers;
277 (
unsigned int srcId,
unsigned int dstId
280 ,
unsigned int srcColorAttachment,
unsigned int dstColorAttachment );
283 (
unsigned int srcId,
unsigned int dstId
284 ,
unsigned int srcX0,
unsigned int srcY0
285 ,
unsigned int dstX0,
unsigned int dstY0
286 ,
unsigned int srcWidth,
unsigned int srcHeight
287 ,
unsigned int dstWidth,
unsigned int dstHeight
289 ,
unsigned int srcColorAttachment,
unsigned int dstColorAttachment );
303 #define CARNA_RENDER_TO_FRAMEBUFFER_EX( fbo, binding, instructions ) \ 305 Carna::base::Framebuffer::Binding binding( fbo ); \ 317 #define CARNA_RENDER_TO_FRAMEBUFFER( fbo, instructions ) \ 318 CARNA_RENDER_TO_FRAMEBUFFER_EX( fbo, fboBinding##__COUNTER__, instructions ) 326 #endif // FRAMEBUFFER_H_6014714286 Maintains the binding of a Framebuffer in a RAII-manner.
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
unsigned int height() const
Returns the framebuffer's height.
Acts like MinimalBinding, but checks the bound framebuffer for validity and allows rendering...
const unsigned int id
Identifies the maintained framebuffer object.
Represents a color. Objects from this class are copyable and assignable.
Defines a rendering viewport. The viewport is a property of the current OpenGL context.
Framebuffer & fbo
References the bound framebuffer.
unsigned int width() const
Returns the framebuffer's width.
Eigen::Matrix< unsigned int, 2, 1 > Vector2ui
Defines vector.
Maintains a framebuffer object that supports up to 8 color components simultaneously.
#define NON_COPYABLE
Features class it is placed in as non-copyable.