SLProject 4.0.000
SLGLFrameBuffer Class Reference

#include <SLGLFrameBuffer.h>

Public Member Functions

 SLGLFrameBuffer (SLsizei rboWidth, SLsizei rboHeight)
 Constructor. More...
 
virtual ~SLGLFrameBuffer ()
 
void clear ()
 Calls delete and clears data. More...
 
void deleteGL ()
 Deletes this buffers. More...
 
void generate ()
 Generates the framebuffer. More...
 
void bind ()
 Binds the framebuffer and renderbuffer. More...
 
void unbind ()
 Unbinds the framebuffer and renderbuffer. More...
 
void bindAndSetBufferStorage (SLsizei width, SLsizei height)
 Sets the size of the buffer storage. More...
 
void attachTexture2D (SLenum attachment, SLenum target, SLGLTexture *texture, SLint level=0)
 Attaches texture image to framebuffer. More...
 
SLuint fboId ()
 
SLuint rboId ()
 
SLsizei rboWidth ()
 
SLsizei rboHeight ()
 

Static Public Attributes

static SLuint totalBufferCount = 0
 
static SLuint totalBufferSize = 0
 static total no. of buffers in use More...
 

Protected Attributes

SLuint _fboId
 static total size of all buffers in bytes More...
 
SLuint _prevFboId
 previously active frame buffer identifier More...
 
SLuint _rboId
 render buffer identifier More...
 
SLuint _sizeBytes
 size in bytes of this buffer More...
 
SLsizei _rboWidth
 width of the render buffer More...
 
SLsizei _rboHeight
 height of the render buffer More...
 

Detailed Description

The frame buffer class generates a frame buffer and a render buffer, with the default size of 512x512, this can also in run time be changed.

Constructor & Destructor Documentation

◆ SLGLFrameBuffer()

SLGLFrameBuffer::SLGLFrameBuffer ( SLsizei  rboWidth,
SLsizei  rboHeight 
)

Constructor.

◆ ~SLGLFrameBuffer()

virtual SLGLFrameBuffer::~SLGLFrameBuffer ( )
inlinevirtual

Member Function Documentation

◆ attachTexture2D()

void SLGLFrameBuffer::attachTexture2D ( SLenum  attachment,
SLenum  target,
SLGLTexture texture,
SLint  level = 0 
)

Attaches texture image to framebuffer.

attach one 2D texture to the frame buffer

◆ bind()

void SLGLFrameBuffer::bind ( )

Binds the framebuffer and renderbuffer.

◆ bindAndSetBufferStorage()

void SLGLFrameBuffer::bindAndSetBufferStorage ( SLsizei  width,
SLsizei  height 
)

Sets the size of the buffer storage.

change the render buffer size at will

◆ clear()

void SLGLFrameBuffer::clear ( )

Calls delete and clears data.

clear delete buffers and respectively adjust the stats variables

◆ deleteGL()

void SLGLFrameBuffer::deleteGL ( )

Deletes this buffers.

calls the delete functions only if the buffers exist

◆ fboId()

SLuint SLGLFrameBuffer::fboId ( )
inline

◆ generate()

void SLGLFrameBuffer::generate ( )

Generates the framebuffer.

generate the frame buffer and the render buffer if wanted

◆ rboHeight()

SLsizei SLGLFrameBuffer::rboHeight ( )
inline

◆ rboId()

SLuint SLGLFrameBuffer::rboId ( )
inline

◆ rboWidth()

SLsizei SLGLFrameBuffer::rboWidth ( )
inline

◆ unbind()

void SLGLFrameBuffer::unbind ( )

Unbinds the framebuffer and renderbuffer.

Member Data Documentation

◆ _fboId

SLuint SLGLFrameBuffer::_fboId
protected

static total size of all buffers in bytes

frame buffer identifier

◆ _prevFboId

SLuint SLGLFrameBuffer::_prevFboId
protected

previously active frame buffer identifier

◆ _rboHeight

SLsizei SLGLFrameBuffer::_rboHeight
protected

height of the render buffer

◆ _rboId

SLuint SLGLFrameBuffer::_rboId
protected

render buffer identifier

◆ _rboWidth

SLsizei SLGLFrameBuffer::_rboWidth
protected

width of the render buffer

◆ _sizeBytes

SLuint SLGLFrameBuffer::_sizeBytes
protected

size in bytes of this buffer

◆ totalBufferCount

SLuint SLGLFrameBuffer::totalBufferCount = 0
static

◆ totalBufferSize

SLuint SLGLFrameBuffer::totalBufferSize = 0
static

static total no. of buffers in use


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