MaterialX 1.39.1
Loading...
Searching...
No Matches
GLFramebuffer Class Reference

Wrapper for an OpenGL framebuffer. More...

#include <GLFramebuffer.h>

Public Member Functions

virtual ~GLFramebuffer ()
 Destructor.
 
unsigned int getWidth () const
 Return the width of the framebuffer.
 
unsigned int getHeight () const
 Return the height of the framebuffer.
 
void setEncodeSrgb (bool encode)
 Set the encode sRGB flag, which controls whether values written to the framebuffer are encoded to the sRGB color space.
 
bool getEncodeSrgb ()
 Return the encode sRGB flag.
 
void bind ()
 Bind the framebuffer for rendering.
 
void unbind ()
 Unbind the frame buffer after rendering.
 
unsigned int getColorTexture () const
 Return our color texture handle.
 
unsigned int getDepthTexture () const
 Return our depth texture handle.
 
ImagePtr getColorImage (ImagePtr image=nullptr)
 Return the color data of this framebuffer as an image. More...
 
void blit ()
 Blit our color texture to the back buffer.
 

Static Public Member Functions

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

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.

Member Function Documentation

◆ getColorImage()

ImagePtr 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.


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