WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
ViewportFBO Struct Reference

Simple OpenGL framebuffer object wrapper for off-screen rendering. More...

#include <ViewportFBO.h>

Public Member Functions

void create (int w, int h)
 Allocate GPU resources at the given resolution.
 
void resize (int w, int h)
 Resize the FBO; destroys and recreates if dimensions changed.
 
void bind () const
 Bind this FBO as the current render target.
 
void unbind () const
 Unbind (revert to the default framebuffer).
 
void destroy ()
 Release all GPU resources.
 

Public Attributes

GLuint fbo = 0
 Framebuffer object handle.
 
GLuint colorTex = 0
 Colour attachment (GL_RGBA8 texture).
 
GLuint depthRbo = 0
 Depth attachment (GL_DEPTH_COMPONENT24 renderbuffer).
 
int width = 0
 Current width in pixels.
 
int height = 0
 Current height in pixels.
 

Detailed Description

Simple OpenGL framebuffer object wrapper for off-screen rendering.

Manages the lifetime of an FBO, colour texture, and depth renderbuffer. Used by the viewport to render the 3D scene into an ImGui image.

Definition at line 9 of file ViewportFBO.h.

Member Function Documentation

◆ bind()

void ViewportFBO::bind ( ) const
inline

Bind this FBO as the current render target.

Definition at line 53 of file ViewportFBO.h.

Here is the caller graph for this function:

◆ create()

void ViewportFBO::create ( int  w,
int  h 
)
inline

Allocate GPU resources at the given resolution.

Definition at line 18 of file ViewportFBO.h.

Here is the caller graph for this function:

◆ destroy()

void ViewportFBO::destroy ( )
inline

Release all GPU resources.

Definition at line 59 of file ViewportFBO.h.

Here is the caller graph for this function:

◆ resize()

void ViewportFBO::resize ( int  w,
int  h 
)
inline

Resize the FBO; destroys and recreates if dimensions changed.

Definition at line 43 of file ViewportFBO.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unbind()

void ViewportFBO::unbind ( ) const
inline

Unbind (revert to the default framebuffer).

Definition at line 56 of file ViewportFBO.h.

Here is the caller graph for this function:

Member Data Documentation

◆ colorTex

GLuint ViewportFBO::colorTex = 0

Colour attachment (GL_RGBA8 texture).

Definition at line 12 of file ViewportFBO.h.

◆ depthRbo

GLuint ViewportFBO::depthRbo = 0

Depth attachment (GL_DEPTH_COMPONENT24 renderbuffer).

Definition at line 13 of file ViewportFBO.h.

◆ fbo

GLuint ViewportFBO::fbo = 0

Framebuffer object handle.

Definition at line 11 of file ViewportFBO.h.

◆ height

int ViewportFBO::height = 0

Current height in pixels.

Definition at line 15 of file ViewportFBO.h.

◆ width

int ViewportFBO::width = 0

Current width in pixels.

Definition at line 14 of file ViewportFBO.h.


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