Visualization Library 2.1.0

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vl::FBORenderbufferAttachment Class Referenceabstract

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:

Public Member Functions

 FBORenderbufferAttachment ()
 Constructor. More...
 
 ~FBORenderbufferAttachment ()
 Destructor. More...
 
void createRenderBuffer ()
 Creates a renderbuffer object calling glGenRenderbuffers(). More...
 
void deleteRenderBuffer ()
 Deletes the renderbuffer object created with the createRenderBuffer() method. More...
 
void setHandle (GLuint handle)
 Sets the handle for this attachment, the handle must have been created by glGenRenderbuffers(). More...
 
GLuint handle () const
 Returns the handle obtained by createRenderBuffer() using glGenRenderbuffers() More...
 
void initStorage (int w, int h, int samples)
 Initializes the storage of the renderbuffer with the given sample count and dimensions. More...
 
void initStorage ()
 The same as calling initStorage( width(), height() ) More...
 
int width () const
 Returns the with of the renderbuffer storage. More...
 
int height () const
 Returns the height of the renderbuffer storage. More...
 
int samples () const
 Returns the number of samples to be used when allocating the renderbuffer's storage. More...
 
void setWidth (int w)
 The width of the renderbuffer storage to be allocated. More...
 
void setHeight (int h)
 The height of the renderbuffer storage to be allocated. More...
 
void setSamples (int samples)
 Sets the number of samples to be specified when allocating the renderbuffer's storage. More...
 
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. More...
 
- Public Member Functions inherited from vl::FBOAbstractAttachment
 FBOAbstractAttachment ()
 Constructor. More...
 
virtual ~FBOAbstractAttachment ()
 Destructor. More...
 
virtual void unbindFromAllFBO ()
 Removes the FBO attachment from all bound FBO render targets. More...
 
const std::set< ref< FramebufferObject > > & fboFramebuffers () const
 Returns an std::set containing the FramebufferObject that use this FBO attachment. More...
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Protected Member Functions

void bindAttachment (FramebufferObject *fbo, EAttachmentPoint attach_point)
 
virtual int internalType ()=0
 
- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Protected Attributes

GLuint mHandle
 
int mWidth
 
int mHeight
 
int mSamples
 
bool mReallocateRenderbuffer
 
- Protected Attributes inherited from vl::FBOAbstractAttachment
std::set< ref< FramebufferObject > > mFramebufferObjects
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Friends

class FramebufferObject
 

Detailed Description

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

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

Definition at line 93 of file FramebufferObject.hpp.

Constructor & Destructor Documentation

◆ FBORenderbufferAttachment()

vl::FBORenderbufferAttachment::FBORenderbufferAttachment ( )
inline

Constructor.

Definition at line 101 of file FramebufferObject.hpp.

◆ ~FBORenderbufferAttachment()

vl::FBORenderbufferAttachment::~FBORenderbufferAttachment ( )
inline

Destructor.

Definition at line 104 of file FramebufferObject.hpp.

Member Function Documentation

◆ bindAttachment()

void FBORenderbufferAttachment::bindAttachment ( FramebufferObject fbo,
EAttachmentPoint  attach_point 
)
protectedvirtual

◆ createRenderBuffer()

void FBORenderbufferAttachment::createRenderBuffer ( )

Creates a renderbuffer object calling glGenRenderbuffers().

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

Definition at line 635 of file FramebufferObject.cpp.

References vl::Has_FBO, VL_CHECK, and VL_CHECK_OGL.

◆ deleteRenderBuffer()

void FBORenderbufferAttachment::deleteRenderBuffer ( )

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

Definition at line 649 of file FramebufferObject.cpp.

References vl::Has_FBO, VL_CHECK, and VL_CHECK_OGL.

◆ handle()

GLuint vl::FBORenderbufferAttachment::handle ( ) const
inline

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

Definition at line 122 of file FramebufferObject.hpp.

◆ height()

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 148 of file FramebufferObject.hpp.

◆ initStorage() [1/2]

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 668 of file FramebufferObject.cpp.

References vl::Log::error(), vl::Has_FBO, vl::Has_FBO_Multisample, VL_CHECK, and VL_CHECK_OGL.

◆ initStorage() [2/2]

void vl::FBORenderbufferAttachment::initStorage ( )
inline

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

Definition at line 134 of file FramebufferObject.hpp.

References initStorage().

Referenced by initStorage().

◆ internalType()

virtual int vl::FBORenderbufferAttachment::internalType ( )
protectedpure virtual

◆ renderbufferStorageReady()

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 175 of file FramebufferObject.hpp.

◆ samples()

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 155 of file FramebufferObject.hpp.

◆ setHandle()

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 119 of file FramebufferObject.hpp.

◆ setHeight()

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 167 of file FramebufferObject.hpp.

◆ setSamples()

void vl::FBORenderbufferAttachment::setSamples ( int  samples)
inline

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

Definition at line 172 of file FramebufferObject.hpp.

◆ setWidth()

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 161 of file FramebufferObject.hpp.

◆ width()

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 141 of file FramebufferObject.hpp.

Friends And Related Function Documentation

◆ FramebufferObject

friend class FramebufferObject
friend

Definition at line 97 of file FramebufferObject.hpp.

Member Data Documentation

◆ mHandle

GLuint vl::FBORenderbufferAttachment::mHandle
protected

Definition at line 182 of file FramebufferObject.hpp.

◆ mHeight

int vl::FBORenderbufferAttachment::mHeight
protected

Definition at line 184 of file FramebufferObject.hpp.

◆ mReallocateRenderbuffer

bool vl::FBORenderbufferAttachment::mReallocateRenderbuffer
protected

Definition at line 186 of file FramebufferObject.hpp.

◆ mSamples

int vl::FBORenderbufferAttachment::mSamples
protected

Definition at line 185 of file FramebufferObject.hpp.

◆ mWidth

int vl::FBORenderbufferAttachment::mWidth
protected

Definition at line 183 of file FramebufferObject.hpp.


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