Frame-buffer object class. More...

#include <frame_buffer.h>

Public Member Functions

 FrameBuffer ()
 Constructs a null instance.
 
 FrameBuffer (GraphicContext &context)
 Constructs a FrameBuffer.
 
void attach_color (int attachment_index, const RenderBuffer &render_buffer)
 Attach color buffer.
 
void attach_color (int attachment_index, const Texture1D &texture, int level=0)
 Attach color buffer.
 
void attach_color (int attachment_index, const Texture1DArray &texture, int array_index=-1, int level=0)
 Attach color buffer.
 
void attach_color (int attachment_index, const Texture2D &texture, int level=0)
 Attach color buffer.
 
void attach_color (int attachment_index, const Texture2DArray &texture, int array_index=-1, int level=0)
 Attach color buffer.
 
void attach_color (int attachment_index, const Texture3D &texture, int depth, int level=0)
 Attach color buffer.
 
void attach_color (int attachment_index, const TextureCube &texture, TextureSubtype subtype, int level=0)
 Attach color buffer.
 
void attach_depth (const RenderBuffer &render_buffer)
 
void attach_depth (const Texture2D &texture, int level=0)
 
void attach_depth (const TextureCube &texture, TextureSubtype subtype, int level=0)
 
void attach_depth_stencil (const RenderBuffer &render_buffer)
 
void attach_depth_stencil (const Texture2D &texture, int level=0)
 
void attach_depth_stencil (const TextureCube &texture, TextureSubtype subtype, int level=0)
 
void attach_stencil (const RenderBuffer &render_buffer)
 
void attach_stencil (const Texture2D &texture, int level=0)
 
void attach_stencil (const TextureCube &texture, TextureSubtype subtype, int level=0)
 
void detach_color (int attachment_index)
 Detach color buffer.
 
void detach_depth ()
 
void detach_depth_stencil ()
 
void detach_stencil ()
 
FrameBufferBindTarget get_bind_target () const
 Get the bind target of the framebuffer.
 
float get_pixel_ratio () const
 
FrameBufferProviderget_provider () const
 Get Provider.
 
Size get_size () const
 Get the minumum size of all the frame buffer attachments.
 
bool is_null () const
 Returns true if this object is invalid.
 
 operator bool () const
 
bool operator== (const FrameBuffer &other) const
 Equality operator.
 
void set_bind_target (FrameBufferBindTarget target)
 Set the bind target of the framebuffer to either drawn to or read from.
 
void throw_if_null () const
 Throw an exception if this object is invalid.
 

Detailed Description

Frame-buffer object class.

Constructor & Destructor Documentation

◆ FrameBuffer() [1/2]

clan::FrameBuffer::FrameBuffer ( )

Constructs a null instance.

◆ FrameBuffer() [2/2]

clan::FrameBuffer::FrameBuffer ( GraphicContext context)

Constructs a FrameBuffer.

By default, the bind target is set to framebuffer_draw. See set_bind_target()

Parameters
context= Graphic Context

Member Function Documentation

◆ attach_color() [1/7]

void clan::FrameBuffer::attach_color ( int  attachment_index,
const RenderBuffer render_buffer 
)

Attach color buffer.

Parameters
attachment_index= value
render_buffer= Render Buffer

◆ attach_color() [2/7]

void clan::FrameBuffer::attach_color ( int  attachment_index,
const Texture1D texture,
int  level = 0 
)

Attach color buffer.

Parameters
attachment_index= value
texture= Texture
level= value

◆ attach_color() [3/7]

void clan::FrameBuffer::attach_color ( int  attachment_index,
const Texture1DArray texture,
int  array_index = -1,
int  level = 0 
)

Attach color buffer.

Parameters
attachment_index= value
texture= Texture
array_index= value
level= value

◆ attach_color() [4/7]

void clan::FrameBuffer::attach_color ( int  attachment_index,
const Texture2D texture,
int  level = 0 
)

Attach color buffer.

Parameters
attachment_index= value
texture= Texture
level= value

◆ attach_color() [5/7]

void clan::FrameBuffer::attach_color ( int  attachment_index,
const Texture2DArray texture,
int  array_index = -1,
int  level = 0 
)

Attach color buffer.

Parameters
attachment_index= value
texture= Texture
array_index= value
level= value

◆ attach_color() [6/7]

void clan::FrameBuffer::attach_color ( int  attachment_index,
const Texture3D texture,
int  depth,
int  level = 0 
)

Attach color buffer.

Parameters
attachment_index= value
texture= Texture
depth= value
level= value

◆ attach_color() [7/7]

void clan::FrameBuffer::attach_color ( int  attachment_index,
const TextureCube texture,
TextureSubtype  subtype,
int  level = 0 
)

Attach color buffer.

Parameters
attachment_index= value
texture= Texture
subtype= Texture Subtype
level= value
zoffset= value

◆ attach_depth() [1/3]

void clan::FrameBuffer::attach_depth ( const RenderBuffer render_buffer)

◆ attach_depth() [2/3]

void clan::FrameBuffer::attach_depth ( const Texture2D texture,
int  level = 0 
)

◆ attach_depth() [3/3]

void clan::FrameBuffer::attach_depth ( const TextureCube texture,
TextureSubtype  subtype,
int  level = 0 
)

◆ attach_depth_stencil() [1/3]

void clan::FrameBuffer::attach_depth_stencil ( const RenderBuffer render_buffer)

◆ attach_depth_stencil() [2/3]

void clan::FrameBuffer::attach_depth_stencil ( const Texture2D texture,
int  level = 0 
)

◆ attach_depth_stencil() [3/3]

void clan::FrameBuffer::attach_depth_stencil ( const TextureCube texture,
TextureSubtype  subtype,
int  level = 0 
)

◆ attach_stencil() [1/3]

void clan::FrameBuffer::attach_stencil ( const RenderBuffer render_buffer)

◆ attach_stencil() [2/3]

void clan::FrameBuffer::attach_stencil ( const Texture2D texture,
int  level = 0 
)

◆ attach_stencil() [3/3]

void clan::FrameBuffer::attach_stencil ( const TextureCube texture,
TextureSubtype  subtype,
int  level = 0 
)

◆ detach_color()

void clan::FrameBuffer::detach_color ( int  attachment_index)

Detach color buffer.

Parameters
attachment_index= value
texture= Texture
level= value
zoffset= value

◆ detach_depth()

void clan::FrameBuffer::detach_depth ( )

◆ detach_depth_stencil()

void clan::FrameBuffer::detach_depth_stencil ( )

◆ detach_stencil()

void clan::FrameBuffer::detach_stencil ( )

◆ get_bind_target()

FrameBufferBindTarget clan::FrameBuffer::get_bind_target ( ) const

Get the bind target of the framebuffer.

Returns
The bind target

◆ get_pixel_ratio()

float clan::FrameBuffer::get_pixel_ratio ( ) const

Retrieves the pixel ratio of this texture.

Returns
The display pixel ratio set for this texture. A zero value implies that no pixel ratio has been set

◆ get_provider()

FrameBufferProvider * clan::FrameBuffer::get_provider ( ) const

Get Provider.

Returns
provider

◆ get_size()

Size clan::FrameBuffer::get_size ( ) const

Get the minumum size of all the frame buffer attachments.

Returns
size

◆ is_null()

bool clan::FrameBuffer::is_null ( ) const
inline

Returns true if this object is invalid.

◆ operator bool()

clan::FrameBuffer::operator bool ( ) const
inlineexplicit

◆ operator==()

bool clan::FrameBuffer::operator== ( const FrameBuffer other) const

Equality operator.

◆ set_bind_target()

void clan::FrameBuffer::set_bind_target ( FrameBufferBindTarget  target)

Set the bind target of the framebuffer to either drawn to or read from.

Detach existing textures and renderbuffers before setting a new bind target

Parameters
target= Target

◆ throw_if_null()

void clan::FrameBuffer::throw_if_null ( ) const

Throw an exception if this object is invalid.


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