SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
sgct::OffScreenBuffer Class Reference

Helper class for creating frame buffer objects and render buffer objects. More...

#include <sgct/offscreenbuffer.h>

Public Member Functions

 OffScreenBuffer (unsigned int internalFormat)
 ~OffScreenBuffer ()
void createFBO (int width, int height, int samples=1)
void resizeFBO (int width, int height, int samples=1)
void attachColorTexture (unsigned int texId, unsigned int attachment) const
void attachDepthTexture (unsigned int texId) const
void attachCubeMapTexture (unsigned int texId, unsigned int face, unsigned int attachment) const
void attachCubeMapDepthTexture (unsigned int texId, unsigned int face) const
void bind () const
 Bind framebuffer, auto-set multisampling and draw buffers.
void bind (bool isMultisampled, int n, const unsigned int *bufs) const
 Bind framebuffer.
void bindBlit () const
void blit () const
bool isMultiSampled () const

Static Public Member Functions

static void unbind ()

Detailed Description

Helper class for creating frame buffer objects and render buffer objects.

Constructor & Destructor Documentation

◆ OffScreenBuffer()

sgct::OffScreenBuffer::OffScreenBuffer ( unsigned int internalFormat)
explicit

◆ ~OffScreenBuffer()

sgct::OffScreenBuffer::~OffScreenBuffer ( )

Member Function Documentation

◆ attachColorTexture()

void sgct::OffScreenBuffer::attachColorTexture ( unsigned int texId,
unsigned int attachment ) const
Parameters
texIdGL id of the texture to attach
attachmentThe gl attachment enum in the form of GL_COLOR_ATTACHMENTi

◆ attachCubeMapDepthTexture()

void sgct::OffScreenBuffer::attachCubeMapDepthTexture ( unsigned int texId,
unsigned int face ) const

◆ attachCubeMapTexture()

void sgct::OffScreenBuffer::attachCubeMapTexture ( unsigned int texId,
unsigned int face,
unsigned int attachment ) const
Parameters
texIdGL id of the texture to attach
faceThe target cubemap face
attachmentThe gl attachment enum in the form of GL_COLOR_ATTACHMENTi

◆ attachDepthTexture()

void sgct::OffScreenBuffer::attachDepthTexture ( unsigned int texId) const

◆ bind() [1/2]

void sgct::OffScreenBuffer::bind ( ) const

Bind framebuffer, auto-set multisampling and draw buffers.

◆ bind() [2/2]

void sgct::OffScreenBuffer::bind ( bool isMultisampled,
int n,
const unsigned int * bufs ) const

Bind framebuffer.

Parameters
isMultisampledtrue if MSAA should be used
nNumber of color buffers
bufsArray with color buffers (GL_COLOR_ATTACHMENTn)

◆ bindBlit()

void sgct::OffScreenBuffer::bindBlit ( ) const

◆ blit()

void sgct::OffScreenBuffer::blit ( ) const

◆ createFBO()

void sgct::OffScreenBuffer::createFBO ( int width,
int height,
int samples = 1 )

◆ isMultiSampled()

bool sgct::OffScreenBuffer::isMultiSampled ( ) const

◆ resizeFBO()

void sgct::OffScreenBuffer::resizeFBO ( int width,
int height,
int samples = 1 )

◆ unbind()

void sgct::OffScreenBuffer::unbind ( )
static

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