nux-0.9.48

nux::GLFramebufferObject Class Reference

#include <NuxGraphics/GLDeviceFrameBufferObject.h>

Public Member Functions

 GLFramebufferObject ()
 Ctor/Dtor.
virtual ~GLFramebufferObject ()
void Bind ()
 Bind this FBO as current render target.
virtual void AttachTexture (GLenum attachment, GLenum texType, GLuint texId, int mipLevel=0, int zSlice=0)
 Bind a texture to the "attachment" point of this FBO.
virtual void AttachTextures (int numTextures, GLenum texTarget[], GLuint texId[], GLenum attachment[]=NULL, int mipLevel[]=NULL, int zSlice[]=NULL)
 Bind an array of textures to multiple "attachment" points of this FBO

  • By default, the first 'numTextures' attachments are used, starting with GL_COLOR_ATTACHMENT0_EXT.

virtual void AttachRenderBuffer (GLenum attachment, GLuint buffId)
 Bind a render buffer to the "attachment" point of this FBO.
void Unattach (GLenum attachment)
 Free any resource bound to the "attachment" point of this FBO.
bool IsValid ()
 Is this FBO currently a valid render target?

  • Sends output to std::cerr by default but can be a user-defined C++ stream.

GLenum GetAttachedType (GLenum attachment)
 BEGIN : Accessors Is attached type GL_RENDERBUFFER_EXT or GL_TEXTURE?
GLuint GetAttachedId (GLenum attachment)
 What is the Id of Renderbuffer/texture currently attached to "attachement?".
GLint GetAttachedMipLevel (GLenum attachment)
 Which mipmap level is currently attached to "attachement?".
GLint GetAttachedCubeFace (GLenum attachment)
 Which cube face is currently attached to "attachment?".
GLint GetAttachedZSlice (GLenum attachment)
 Which z-slice is currently attached to "attachment?".

Static Public Member Functions

static int GetMaxColorAttachments ()
 END : Accessors.
static void Disable ()
 Disable all FBO rendering and return to traditional, windowing-system controlled framebuffer NOTE: This is NOT an "unbind" for this specific FBO, but rather disables all FBO rendering.

Constructor & Destructor Documentation

nux::GLFramebufferObject::GLFramebufferObject ( )

Ctor/Dtor.

virtual nux::GLFramebufferObject::~GLFramebufferObject ( ) [virtual]

Member Function Documentation

virtual void nux::GLFramebufferObject::AttachRenderBuffer ( GLenum  attachment,
GLuint  buffId 
) [virtual]

Bind a render buffer to the "attachment" point of this FBO.

virtual void nux::GLFramebufferObject::AttachTexture ( GLenum  attachment,
GLenum  texType,
GLuint  texId,
int  mipLevel = 0,
int  zSlice = 0 
) [virtual]

Bind a texture to the "attachment" point of this FBO.

virtual void nux::GLFramebufferObject::AttachTextures ( int  numTextures,
GLenum  texTarget[],
GLuint  texId[],
GLenum  attachment[] = NULL,
int  mipLevel[] = NULL,
int  zSlice[] = NULL 
) [virtual]

Bind an array of textures to multiple "attachment" points of this FBO

  • By default, the first 'numTextures' attachments are used, starting with GL_COLOR_ATTACHMENT0_EXT.

void nux::GLFramebufferObject::Bind ( )

Bind this FBO as current render target.

static void nux::GLFramebufferObject::Disable ( ) [static]

Disable all FBO rendering and return to traditional, windowing-system controlled framebuffer NOTE: This is NOT an "unbind" for this specific FBO, but rather disables all FBO rendering.

This call is intentionally "static" and named "Disable" instead of "Unbind" for this reason. The motivation for this strange semantic is performance. Providing "Unbind" would likely lead to a large number of unnecessary FBO enablings/disabling.

GLint nux::GLFramebufferObject::GetAttachedCubeFace ( GLenum  attachment)

Which cube face is currently attached to "attachment?".

GLuint nux::GLFramebufferObject::GetAttachedId ( GLenum  attachment)

What is the Id of Renderbuffer/texture currently attached to "attachement?".

GLint nux::GLFramebufferObject::GetAttachedMipLevel ( GLenum  attachment)

Which mipmap level is currently attached to "attachement?".

GLenum nux::GLFramebufferObject::GetAttachedType ( GLenum  attachment)

BEGIN : Accessors Is attached type GL_RENDERBUFFER_EXT or GL_TEXTURE?

GLint nux::GLFramebufferObject::GetAttachedZSlice ( GLenum  attachment)

Which z-slice is currently attached to "attachment?".

static int nux::GLFramebufferObject::GetMaxColorAttachments ( ) [static]

END : Accessors.

BEGIN : Static methods global to all FBOs Return number of color attachments permitted

bool nux::GLFramebufferObject::IsValid ( )

Is this FBO currently a valid render target?

  • Sends output to std::cerr by default but can be a user-defined C++ stream.

NOTE : This function works correctly in debug build mode but always returns "true" if NDEBUG is is defined (optimized builds)

void nux::GLFramebufferObject::Unattach ( GLenum  attachment)

Free any resource bound to the "attachment" point of this FBO.


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