Class FrameBuffer

Nested Relationships

Nested Types

Class Documentation

class FrameBuffer

An OpenGL FrameBuffer resource (FBO) with either RGBA+depth or depth only render buffers.

Refer to docs for glGenFramebuffers() and glGenRenderbuffers().

See also

Buffer, DepthMapFBO

Main API

inline void create(unsigned int width, unsigned int height, int nSamples = 1)

Creates a new FB object and the two (RGBA+depth) render buffers.

inline void createDepthMap(unsigned int width, unsigned int height)

Creates a new depth-only FBO.

inline void destroy()

Release resources

inline FrameBufferBinding bind()

Bind this framebuffer object to the current context.

See also

Bind(), CurrentBinding()

Returns:

The former binding

inline void unbind()

Unbind the framebuffer object from the context

void blit()

Blit the framebuffer object onto the screen.

inline bool initialized() const
inline unsigned int width() const
inline unsigned int height() const
inline int numSamples() const
inline unsigned int depthMapTextureId() const

Static methods

static void Bind(const FrameBufferBinding &ids)
static void Unbind()

Calls glBindFramebuffer(GL_FRAMEBUFFER, 0);.

static FrameBufferBinding CurrentBinding()

Public Functions

FrameBuffer() = default

Protected Attributes

RAII_Impl m_impl
struct RAII_Impl

Public Functions

RAII_Impl() = default
inline ~RAII_Impl()
void create(unsigned int width, unsigned int height, int nSamples)
void createDepthMap(unsigned int width, unsigned int height)
void destroy()
FrameBufferBinding bind()
void unbind()

Public Members

Buffer::Type type
Buffer::Usage usage = Buffer::Usage::StaticDraw
mrpt::containers::PerThreadDataHolder<State> m_state
struct State

Public Members

bool m_created = false
bool m_isDepthMap = false
unsigned int m_Framebuffer = 0
unsigned int m_Depth = 0
unsigned int m_Color = 0
unsigned int m_DepthMapTexture = 0
unsigned int m_width = 0
unsigned int m_height = 0
int m_Samples = 0

In pixels.