# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Member Functions | Protected Attributes | Friends

# vl::FBORenderbufferAttachment Class Reference

Abstract class that represents a framebuffer renderbuffer attachment, that is, a non-texture fbo attachment (wraps `glFramebufferRenderbuffer()`). More...

`#include <FramebufferObject.hpp>`

Inheritance diagram for vl::FBORenderbufferAttachment:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| FBORenderbufferAttachment ()
| Constructor.
void | create ()
| Creates a renderbuffer object calling glGenRenderbuffers().
void | destroy ()
| Deletes the renderbuffer object created with the create() method.
void | setHandle (GLuint handle)
| Sets the handle for this attachment, the handle must have been created by glGenRenderbuffers().
GLuint | handle () const
| Returns the handle obtained by create() using glGenRenderbuffers()
void | initStorage (int w, int h, int samples)
| Initializes the storage of the renderbuffer with the given sample count and dimensions.
void | initStorage ()
| The same as calling initStorage( width(), height() )
int | width () const
| Returns the with of the renderbuffer storage.
int | height () const
| Returns the height of the renderbuffer storage.
int | samples () const
| Returns the number of samples to be used when allocating the renderbuffer's storage.
void | setWidth (int w)
| The width of the renderbuffer storage to be allocated.
void | setHeight (int h)
| The height of the renderbuffer storage to be allocated.
void | setSamples (int samples)
| Sets the number of samples to be specified when allocating the renderbuffer's storage.
bool | renderbufferStorageReady () const
| Returns `false` if the renderbuffer storage needs to be created or reallocated due to a change of the sample count, renderbuffer type or dimension.

## Protected Member Functions

void | bindAttachment (FBORenderTarget *fbo, EAttachmentPoint attach_point)
virtual int | internalType ()=0

## Protected Attributes

GLuint | mHandle
int | mWidth
int | mHeight
int | mSamples
bool | mReallocateRenderbuffer

## Friends

class | FBORenderTarget

## Detailed Description

Abstract class that represents a framebuffer renderbuffer attachment, that is, a non-texture fbo attachment (wraps `glFramebufferRenderbuffer()`).

See also:
  FBORenderTarget.
  http://www.opengl.org/sdk/docs/man3/xhtml/glFramebufferRenderbuffer.xml

Definition at line 87 of file FramebufferObject.hpp.

## Constructor & Destructor Documentation

vl::FBORenderbufferAttachment::FBORenderbufferAttachment | ( | ) | `[inline]`

Constructor.

Definition at line 95 of file FramebufferObject.hpp.

## Member Function Documentation

virtual const char* vl::FBORenderbufferAttachment::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::FBOAbstractAttachment.

Reimplemented in vl::FBOColorBufferAttachment, vl::FBODepthBufferAttachment, vl::FBOStencilBufferAttachment, and vl::FBODepthStencilBufferAttachment.

Definition at line 92 of file FramebufferObject.hpp.

void FBORenderbufferAttachment::create | ( | ) |

Creates a renderbuffer object calling glGenRenderbuffers().

The identifier returned by glGenRenderbuffers() can be queried calling the handle() method.

Definition at line 498 of file FramebufferObject.cpp.

References GLEW_Has_Framebuffer_Object, mHandle, mReallocateRenderbuffer, VL_CHECK, VL_CHECK_OGL, and vl::VL_glGenRenderbuffers().

Referenced by bindAttachment().

void FBORenderbufferAttachment::destroy | ( | ) | `[virtual]`

Deletes the renderbuffer object created with the create() method.

Reimplemented from vl::FBOAbstractAttachment.

Definition at line 512 of file FramebufferObject.cpp.

References GLEW_Has_Framebuffer_Object, mHandle, mHeight, mReallocateRenderbuffer, mWidth, VL_CHECK, VL_CHECK_OGL, and vl::VL_glDeleteRenderbuffers().

void vl::FBORenderbufferAttachment::setHandle | ( | GLuint | handle ) | `[inline]`

Sets the handle for this attachment, the handle must have been created by glGenRenderbuffers().

Normally you don't need to call this. See also: create(), handle().

Definition at line 110 of file FramebufferObject.hpp.

GLuint vl::FBORenderbufferAttachment::handle | ( | ) | const`[inline]`

Returns the handle obtained by create() using glGenRenderbuffers()

Definition at line 113 of file FramebufferObject.hpp.

Referenced by bindAttachment(), and initStorage().

void FBORenderbufferAttachment::initStorage | ( | int | w,
|  | int | h,
|  | int | samples
| ) |  |

Initializes the storage of the renderbuffer with the given sample count and dimensions.

This method does nothing if the the width, height and sample count has not changed since last time it was called. Note that the renderbuffer storage type is defined by the setType() method of FBOColorBufferAttachment, FBODepthBufferAttachment, FBOStencilBufferAttachment, FBODepthStencilBufferAttachment. See also setSamples().

Definition at line 529 of file FramebufferObject.cpp.

References vl::Log::error(), GLEW_Has_Framebuffer_Object, GLEW_Has_Framebuffer_Object_Multisample, handle(), height(), internalType(), mHeight, mReallocateRenderbuffer, mSamples, mWidth, samples(), VL_CHECK, VL_CHECK_OGL, vl::VL_glBindRenderbuffer(), vl::VL_glRenderbufferStorage(), vl::VL_glRenderbufferStorageMultisample(), and width().

void vl::FBORenderbufferAttachment::initStorage | ( | ) | `[inline]`

The same as calling initStorage( width(), height() )

Definition at line 125 of file FramebufferObject.hpp.

References initStorage().

Referenced by bindAttachment(), and initStorage().

int vl::FBORenderbufferAttachment::width | ( | ) | const`[inline]`

Returns the with of the renderbuffer storage.

Note that if renderbufferStorageReady() returns `false` it means that the renderbuffer has not been allocated yet.

Definition at line 132 of file FramebufferObject.hpp.

Referenced by bindAttachment(), and initStorage().

int vl::FBORenderbufferAttachment::height | ( | ) | const`[inline]`

Returns the height of the renderbuffer storage.

Note that if renderbufferStorageReady() returns `false` it means that the renderbuffer has not been allocated yet.

Definition at line 139 of file FramebufferObject.hpp.

Referenced by bindAttachment(), and initStorage().

int vl::FBORenderbufferAttachment::samples | ( | ) | const`[inline]`

Returns the number of samples to be used when allocating the renderbuffer's storage.

Note that if renderbufferStorageReady() returns `false` it means that the renderbuffer has not been allocated yet.

Definition at line 146 of file FramebufferObject.hpp.

Referenced by bindAttachment(), and initStorage().

void vl::FBORenderbufferAttachment::setWidth | ( | int | w ) | `[inline]`

The width of the renderbuffer storage to be allocated.

If 'w' is set to 0 the renderbuffer storage allocation will use the dimensions of the next FBORenderTarget bound.

Definition at line 152 of file FramebufferObject.hpp.

void vl::FBORenderbufferAttachment::setHeight | ( | int | h ) | `[inline]`

The height of the renderbuffer storage to be allocated.

If 'h' is set to 0 the renderbuffer storage allocation will use the dimensions of the next FBORenderTarget bound.

Definition at line 158 of file FramebufferObject.hpp.

void vl::FBORenderbufferAttachment::setSamples | ( | int | samples ) | `[inline]`

Sets the number of samples to be specified when allocating the renderbuffer's storage.

Definition at line 163 of file FramebufferObject.hpp.

bool vl::FBORenderbufferAttachment::renderbufferStorageReady | ( | ) | const`[inline]`

Returns `false` if the renderbuffer storage needs to be created or reallocated due to a change of the sample count, renderbuffer type or dimension.

Definition at line 166 of file FramebufferObject.hpp.

void FBORenderbufferAttachment::bindAttachment | ( | FBORenderTarget * | fbo,
|  | EAttachmentPoint | attach_point
| ) |  | `[protected, virtual]`

Implements vl::FBOAbstractAttachment.

Definition at line 560 of file FramebufferObject.cpp.

References create(), GLEW_Has_Framebuffer_Object, handle(), vl::RenderTarget::height(), height(), initStorage(), samples(), VL_CHECK, VL_CHECK_OGL, vl::VL_glFramebufferRenderbuffer(), vl::RenderTarget::width(), and width().

Referenced by vl::FBORenderTarget::addColorAttachment().

virtual int vl::FBORenderbufferAttachment::internalType | ( | ) | `[protected, pure virtual]`

Implemented in vl::FBOColorBufferAttachment, vl::FBODepthBufferAttachment, vl::FBOStencilBufferAttachment, and vl::FBODepthStencilBufferAttachment.

Referenced by initStorage().

## Friends And Related Function Documentation

friend class FBORenderTarget`[friend]`

Reimplemented from vl::FBOAbstractAttachment.

Definition at line 89 of file FramebufferObject.hpp.

## Member Data Documentation

GLuint vl::FBORenderbufferAttachment::mHandle`[protected]`

Definition at line 173 of file FramebufferObject.hpp.

Referenced by create(), and destroy().

int vl::FBORenderbufferAttachment::mWidth`[protected]`

Definition at line 174 of file FramebufferObject.hpp.

Referenced by destroy(), and initStorage().

int vl::FBORenderbufferAttachment::mHeight`[protected]`

Definition at line 175 of file FramebufferObject.hpp.

Referenced by destroy(), and initStorage().

int vl::FBORenderbufferAttachment::mSamples`[protected]`

Definition at line 176 of file FramebufferObject.hpp.

Referenced by initStorage().

bool vl::FBORenderbufferAttachment::mReallocateRenderbuffer`[protected]`

Definition at line 177 of file FramebufferObject.hpp.

Referenced by create(), destroy(), and initStorage().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/FramebufferObject.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/FramebufferObject.cpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:40.
Permission is granted to use this page to write and publish articles regarding Visualization Library.