6#ifndef MATERIALX_GLFRAMEBUFFER_H
7#define MATERIALX_GLFRAMEBUFFER_H
16MATERIALX_NAMESPACE_BEGIN
29 static GLFramebufferPtr create(
unsigned int width,
unsigned int height,
unsigned int channelCount, Image::BaseType baseType);
86 GLFramebuffer(
unsigned int width,
unsigned int height,
unsigned int channelCount, Image::BaseType baseType);
91 unsigned int _channelCount;
92 Image::BaseType _baseType;
95 unsigned int _framebuffer;
96 unsigned int _colorTexture;
97 unsigned int _depthTexture;
100MATERIALX_NAMESPACE_END
std::shared_ptr< GLFramebuffer > GLFramebufferPtr
Shared pointer to a GLFramebuffer.
Definition: GLFramebuffer.h:21
shared_ptr< Image > ImagePtr
A shared pointer to an image.
Definition: Image.h:23
Image handler interfaces.
Macros for declaring imported and exported symbols.
Wrapper for an OpenGL framebuffer.
Definition: GLFramebuffer.h:26
virtual ~GLFramebuffer()
Destructor.
unsigned int getHeight() const
Return the height of the framebuffer.
Definition: GLFramebuffer.h:41
ImagePtr getColorImage(ImagePtr image=nullptr)
Return the color data of this framebuffer as an image.
void setEncodeSrgb(bool encode)
Set the encode sRGB flag, which controls whether values written to the framebuffer are encoded to the...
Definition: GLFramebuffer.h:48
static GLFramebufferPtr create(unsigned int width, unsigned int height, unsigned int channelCount, Image::BaseType baseType)
Create a new framebuffer.
void bind()
Bind the framebuffer for rendering.
void blit()
Blit our color texture to the back buffer.
unsigned int getColorTexture() const
Return our color texture handle.
Definition: GLFramebuffer.h:66
bool getEncodeSrgb()
Return the encode sRGB flag.
Definition: GLFramebuffer.h:54
unsigned int getWidth() const
Return the width of the framebuffer.
Definition: GLFramebuffer.h:35
unsigned int getDepthTexture() const
Return our depth texture handle.
Definition: GLFramebuffer.h:72
void unbind()
Unbind the frame buffer after rendering.