Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Abstract class that represents a framebuffer renderbuffer attachment, that is, a non-texture fbo attachment (wraps glFramebufferRenderbuffer()
).
More...
#include <FramebufferObject.hpp>
Public Member Functions | |
FBORenderbufferAttachment () | |
Constructor. | |
~FBORenderbufferAttachment () | |
Destructor. | |
void | createRenderBuffer () |
Creates a renderbuffer object calling glGenRenderbuffers(). | |
void | deleteRenderBuffer () |
Deletes the renderbuffer object created with the createRenderBuffer() 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 createRenderBuffer() 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 (FramebufferObject *fbo, EAttachmentPoint attach_point) |
virtual int | internalType ()=0 |
Protected Attributes | |
GLuint | mHandle |
int | mWidth |
int | mHeight |
int | mSamples |
bool | mReallocateRenderbuffer |
Friends | |
class | FramebufferObject |
Abstract class that represents a framebuffer renderbuffer attachment, that is, a non-texture fbo attachment (wraps glFramebufferRenderbuffer()
).
Definition at line 87 of file FramebufferObject.hpp.
vl::FBORenderbufferAttachment::FBORenderbufferAttachment | ( | ) | [inline] |
Constructor.
Definition at line 95 of file FramebufferObject.hpp.
vl::FBORenderbufferAttachment::~FBORenderbufferAttachment | ( | ) | [inline] |
Destructor.
Definition at line 98 of file FramebufferObject.hpp.
void FBORenderbufferAttachment::createRenderBuffer | ( | ) |
Creates a renderbuffer object calling glGenRenderbuffers().
The identifier returned by glGenRenderbuffers() can be queried calling the handle() method.
Definition at line 500 of file FramebufferObject.cpp.
References vl::Has_FBO, mHandle, mReallocateRenderbuffer, VL_CHECK, and VL_CHECK_OGL.
Referenced by bindAttachment().
void FBORenderbufferAttachment::deleteRenderBuffer | ( | ) |
Deletes the renderbuffer object created with the createRenderBuffer() method.
Definition at line 514 of file FramebufferObject.cpp.
References vl::Has_FBO, mHandle, mHeight, mReallocateRenderbuffer, mWidth, vl::FBOAbstractAttachment::unbindFromAllFBO(), VL_CHECK, and VL_CHECK_OGL.
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: createRenderBuffer(), handle().
Definition at line 113 of file FramebufferObject.hpp.
GLuint vl::FBORenderbufferAttachment::handle | ( | ) | const [inline] |
Returns the handle obtained by createRenderBuffer() using glGenRenderbuffers()
Definition at line 116 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 533 of file FramebufferObject.cpp.
References vl::Log::error(), handle(), vl::Has_FBO, vl::Has_FBO_Multisample, height(), internalType(), mHeight, mReallocateRenderbuffer, mSamples, mWidth, samples(), VL_CHECK, VL_CHECK_OGL, and width().
void vl::FBORenderbufferAttachment::initStorage | ( | ) | [inline] |
The same as calling initStorage( width(), height() )
Definition at line 128 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 135 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 142 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 149 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 FramebufferObject bound.
Definition at line 155 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 FramebufferObject bound.
Definition at line 161 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 166 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 169 of file FramebufferObject.hpp.
void FBORenderbufferAttachment::bindAttachment | ( | FramebufferObject * | fbo, |
EAttachmentPoint | attach_point | ||
) | [protected, virtual] |
Implements vl::FBOAbstractAttachment.
Definition at line 564 of file FramebufferObject.cpp.
References createRenderBuffer(), handle(), vl::Has_FBO, vl::Framebuffer::height(), height(), initStorage(), samples(), VL_CHECK, VL_CHECK_OGL, vl::Framebuffer::width(), and width().
Referenced by vl::FramebufferObject::addColorAttachment().
virtual int vl::FBORenderbufferAttachment::internalType | ( | ) | [protected, pure virtual] |
Implemented in vl::FBOColorBufferAttachment, vl::FBODepthBufferAttachment, vl::FBOStencilBufferAttachment, and vl::FBODepthStencilBufferAttachment.
Referenced by initStorage().
friend class FramebufferObject [friend] |
Reimplemented from vl::FBOAbstractAttachment.
Definition at line 91 of file FramebufferObject.hpp.
GLuint vl::FBORenderbufferAttachment::mHandle [protected] |
Definition at line 176 of file FramebufferObject.hpp.
Referenced by createRenderBuffer(), and deleteRenderBuffer().
int vl::FBORenderbufferAttachment::mWidth [protected] |
Definition at line 177 of file FramebufferObject.hpp.
Referenced by deleteRenderBuffer(), and initStorage().
int vl::FBORenderbufferAttachment::mHeight [protected] |
Definition at line 178 of file FramebufferObject.hpp.
Referenced by deleteRenderBuffer(), and initStorage().
int vl::FBORenderbufferAttachment::mSamples [protected] |
Definition at line 179 of file FramebufferObject.hpp.
Referenced by initStorage().
bool vl::FBORenderbufferAttachment::mReallocateRenderbuffer [protected] |
Definition at line 180 of file FramebufferObject.hpp.
Referenced by createRenderBuffer(), deleteRenderBuffer(), and initStorage().