HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GLFramebuffer Class Reference

#include <GLFramebuffer.h>

Public Member Functions

virtual ~GLFramebuffer ()
 Destructor. More...
 
unsigned int getWidth () const
 Return the width of the framebuffer. More...
 
unsigned int getHeight () const
 Return the height of the framebuffer. More...
 
void setEncodeSrgb (bool encode)
 
bool getEncodeSrgb ()
 Return the encode sRGB flag. More...
 
void bind ()
 Bind the framebuffer for rendering. More...
 
void unbind ()
 Unbind the frame buffer after rendering. More...
 
unsigned int getColorTexture () const
 Return our color texture handle. More...
 
unsigned int getDepthTexture () const
 Return our depth texture handle. More...
 
ImagePtr getColorImage (ImagePtr image=nullptr)
 
void blit ()
 Blit our color texture to the back buffer. More...
 

Static Public Member Functions

static GLFramebufferPtr create (unsigned int width, unsigned int height, unsigned int channelCount, Image::BaseType baseType)
 Create a new framebuffer. More...
 

Protected Member Functions

 GLFramebuffer (unsigned int width, unsigned int height, unsigned int channelCount, Image::BaseType baseType)
 

Protected Attributes

unsigned int _width
 
unsigned int _height
 
unsigned int _channelCount
 
Image::BaseType _baseType
 
bool _encodeSrgb
 
unsigned int _framebuffer
 
unsigned int _colorTexture
 
unsigned int _depthTexture
 

Detailed Description

Wrapper for an OpenGL framebuffer

Definition at line 25 of file GLFramebuffer.h.

Constructor & Destructor Documentation

virtual GLFramebuffer::~GLFramebuffer ( )
virtual

Destructor.

GLFramebuffer::GLFramebuffer ( unsigned int  width,
unsigned int  height,
unsigned int  channelCount,
Image::BaseType  baseType 
)
protected

Member Function Documentation

void GLFramebuffer::bind ( )

Bind the framebuffer for rendering.

void GLFramebuffer::blit ( )

Blit our color texture to the back buffer.

static GLFramebufferPtr GLFramebuffer::create ( unsigned int  width,
unsigned int  height,
unsigned int  channelCount,
Image::BaseType  baseType 
)
static

Create a new framebuffer.

ImagePtr GLFramebuffer::getColorImage ( ImagePtr  image = nullptr)

Return the color data of this framebuffer as an image. If an input image is provided, it will be used to store the color data; otherwise a new image of the required format will be created.

unsigned int GLFramebuffer::getColorTexture ( ) const
inline

Return our color texture handle.

Definition at line 66 of file GLFramebuffer.h.

unsigned int GLFramebuffer::getDepthTexture ( ) const
inline

Return our depth texture handle.

Definition at line 72 of file GLFramebuffer.h.

bool GLFramebuffer::getEncodeSrgb ( )
inline

Return the encode sRGB flag.

Definition at line 54 of file GLFramebuffer.h.

unsigned int GLFramebuffer::getHeight ( ) const
inline

Return the height of the framebuffer.

Definition at line 41 of file GLFramebuffer.h.

unsigned int GLFramebuffer::getWidth ( ) const
inline

Return the width of the framebuffer.

Definition at line 35 of file GLFramebuffer.h.

void GLFramebuffer::setEncodeSrgb ( bool  encode)
inline

Set the encode sRGB flag, which controls whether values written to the framebuffer are encoded to the sRGB color space.

Definition at line 48 of file GLFramebuffer.h.

void GLFramebuffer::unbind ( )

Unbind the frame buffer after rendering.

Member Data Documentation

Image::BaseType GLFramebuffer::_baseType
protected

Definition at line 92 of file GLFramebuffer.h.

unsigned int GLFramebuffer::_channelCount
protected

Definition at line 91 of file GLFramebuffer.h.

unsigned int GLFramebuffer::_colorTexture
protected

Definition at line 96 of file GLFramebuffer.h.

unsigned int GLFramebuffer::_depthTexture
protected

Definition at line 97 of file GLFramebuffer.h.

bool GLFramebuffer::_encodeSrgb
protected

Definition at line 93 of file GLFramebuffer.h.

unsigned int GLFramebuffer::_framebuffer
protected

Definition at line 95 of file GLFramebuffer.h.

unsigned int GLFramebuffer::_height
protected

Definition at line 90 of file GLFramebuffer.h.

unsigned int GLFramebuffer::_width
protected

Definition at line 89 of file GLFramebuffer.h.


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