Carna  Version 3.3.2
Public Member Functions | Protected Attributes | List of all members
Carna::base::Framebuffer::MinimalBinding Class Reference

Maintains the binding of a Framebuffer in a RAII-manner. More...

#include <Framebuffer.h>

+ Inheritance diagram for Carna::base::Framebuffer::MinimalBinding:
+ Collaboration diagram for Carna::base::Framebuffer::MinimalBinding:

Public Member Functions

 MinimalBinding (Framebuffer &fbo)
 Binds fbo as the current framebuffer.
 
virtual ~MinimalBinding ()
 Retracts this binding and restores the previous one.
 
void setColorComponent (Texture< 2 > &renderTexture, unsigned int location=0)
 Attaches renderTexture as the color component at location of the bound framebuffer object. More...
 
void removeColorComponent (unsigned int location)
 Removes color component at location from bound framebuffer object. More...
 
Color readPixel (unsigned int x, unsigned int y, unsigned int location=0) const
 Reads the color of the pixel located at x and y within the color attachment at location. More...
 
const Framebufferframebuffer () const
 References the bound framebuffer.
 
virtual void refresh () const
 Re-performs this binding. This is useful if the currently bound framebuffer has been changed through a different mechanism, e.g. using OpenGL calls directly or by another API. More...
 

Protected Attributes

Framebufferfbo
 References the bound framebuffer.
 

Detailed Description

Maintains the binding of a Framebuffer in a RAII-manner.

Bound framebuffers are not checked for validity. Allows manipulation of the bound framebuffer, but not rendering. Use a full Binding if you want to render to the framebuffer.

Author
Leonid Kostrykin
Date
24.4.2011 - 25.3.15

Definition at line 162 of file Framebuffer.h.

Member Function Documentation

◆ readPixel()

Color Carna::base::Framebuffer::MinimalBinding::readPixel ( unsigned int  x,
unsigned int  y,
unsigned int  location = 0 
) const

Reads the color of the pixel located at x and y within the color attachment at location.

Precondition
This is the latest framebuffer binding.

◆ refresh()

virtual void Carna::base::Framebuffer::MinimalBinding::refresh ( ) const
virtual

Re-performs this binding. This is useful if the currently bound framebuffer has been changed through a different mechanism, e.g. using OpenGL calls directly or by another API.

Precondition
This is the latest framebuffer binding.

◆ removeColorComponent()

void Carna::base::Framebuffer::MinimalBinding::removeColorComponent ( unsigned int  location)

Removes color component at location from bound framebuffer object.

Precondition
This is the latest framebuffer binding.

◆ setColorComponent()

void Carna::base::Framebuffer::MinimalBinding::setColorComponent ( Texture< 2 > &  renderTexture,
unsigned int  location = 0 
)

Attaches renderTexture as the color component at location of the bound framebuffer object.

Precondition
This is the latest framebuffer binding.

If there was another color component bound to location previously, it is replaced.


The documentation for this class was generated from the following file: