32 #ifndef FramebufferObject_INCLUDE_ONCE 33 #define FramebufferObject_INCLUDE_ONCE 42 class FramebufferObject;
68 virtual void unbindFromAllFBO();
71 const std::set< ref<FramebufferObject> >&
fboFramebuffers()
const {
return mFramebufferObjects; }
104 void createRenderBuffer();
107 void deleteRenderBuffer();
113 void setHandle( GLuint handle ) {
if ( mHandle != handle ) { mHandle = handle; mReallocateRenderbuffer =
false; } }
116 GLuint
handle()
const {
return mHandle; }
125 void initStorage(
int w,
int h,
int samples );
135 int width()
const {
return mWidth; }
155 void setWidth(
int w ) {
if ( w != mWidth ) mReallocateRenderbuffer =
true; mWidth = w; }
161 void setHeight(
int h ) {
if ( h != mHeight ) mReallocateRenderbuffer =
true; mHeight = h; }
166 void setSamples(
int samples ) {
if ( samples != mSamples ) mReallocateRenderbuffer =
true; mSamples = samples; }
173 virtual int internalType() = 0;
196 VL_DEBUG_SET_OBJECT_NAME()
226 VL_DEBUG_SET_OBJECT_NAME()
256 VL_DEBUG_SET_OBJECT_NAME()
286 VL_DEBUG_SET_OBJECT_NAME()
316 VL_DEBUG_SET_OBJECT_NAME()
353 VL_DEBUG_SET_OBJECT_NAME()
359 VL_DEBUG_SET_OBJECT_NAME()
380 VL_DEBUG_SET_OBJECT_NAME()
387 VL_DEBUG_SET_OBJECT_NAME()
388 mTextureTarget = target;
418 VL_DEBUG_SET_OBJECT_NAME()
424 VL_DEBUG_SET_OBJECT_NAME()
445 VL_DEBUG_SET_OBJECT_NAME()
451 VL_DEBUG_SET_OBJECT_NAME()
459 int layer()
const {
return mLayer; }
482 VL_DEBUG_SET_OBJECT_NAME()
489 VL_DEBUG_SET_OBJECT_NAME()
494 int layer()
const {
return mLayer; }
552 VL_DEBUG_SET_OBJECT_NAME()
558 Framebuffer( ctx, w, h, draw_buffer, read_buffer ), mHandle( 0 )
560 VL_DEBUG_SET_OBJECT_NAME()
583 virtual GLuint
handle()
const {
return mHandle; }
593 GLenum checkFramebufferStatus();
596 void printFramebufferError( GLenum status )
const;
626 void removeAllAttachments();
629 const std::map< EAttachmentPoint, ref<FBOAbstractAttachment> >&
fboAttachments()
const {
return mFBOAttachments; }
void setLayer(int layer)
The layer of a 2-dimensional image within a 3-dimensional texture or texture array.
A 2D texture renderbuffer to be attached to a FramebufferObject (wraps glFramebufferTexture2D()).
int height() const
Returns the height of the renderbuffer storage.
void setHeight(int h)
The height of the renderbuffer storage to be allocated.
Abstract class that represents a framebuffer renderbuffer attachment, that is, a non-texture fbo atta...
int mipmapLevel() const
The mipmap level of the texture to attach.
const Texture * texture() const
The texture bound to this attachment.
FBOTextureLayerAttachment(Texture *texture, int mipmap_level, int layer)
Constructor.
GLuint handle() const
Returns the handle obtained by createRenderBuffer() using glGenRenderbuffers()
~FramebufferObject()
Destructor.
EDepthBufferFormat type() const
The type to specify when allocating the renderbuffer storage.
EColorBufferFormat
Color-renderable formats as defined in section 4.4.4 of opengl api specs 4.1.
void setType(EDepthStencilBufferFormat type)
The type to specify when allocating the renderbuffer storage.
A 3D texture renderbuffer to be attached to a FramebufferObject (wraps glFramebufferTexture3D()).
Abstract class that represents a framebuffer object attachment to be used with FramebufferObject.
A depth+stencil renderbuffer to be attached to a FramebufferObject.
Base class for all the framebuffer texture attachments (see also FramebufferObject).
FBOTexture1DAttachment(Texture *texture, int mipmap_level)
Constructor.
EDepthStencilBufferFormat
std::map< EAttachmentPoint, ref< FBOAbstractAttachment > > mFBOAttachments
Represents an OpenGL context, possibly a widget or a pbuffer, which can also respond to keyboard...
A 1D texture renderbuffer to be attached to a FramebufferObject (wraps glFramebufferTexture1D()).
int layer() const
The layer of a 2-dimensional image within a 3-dimensional texture or texture array.
void setType(EDepthBufferFormat type)
The type to specify when allocating the renderbuffer storage.
Wraps an OpenGL texture object representing and managing all the supported texture types...
FBODepthBufferAttachment(EDepthBufferFormat type=DBF_DEPTH_COMPONENT)
Constructor.
virtual int internalType()
const std::map< EAttachmentPoint, ref< FBOAbstractAttachment > > & fboAttachments() const
A map associating which fbo-attachment belongs to which attachment point in a framebuffer object...
FBOTexture1DAttachment()
Constructor.
FBOColorBufferAttachment(EColorBufferFormat type=CBF_RGBA)
Constructor.
FBOTextureAttachment()
Constructor.
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
FBOAbstractAttachment()
Constructor.
FBODepthStencilBufferAttachment(EDepthStencilBufferFormat type=DSBT_DEPTH_STENCIL)
Constructor.
virtual ~FBOAbstractAttachment()
Destructor.
EDepthStencilBufferFormat mType
virtual int internalType()
int layer() const
The layer of a 2-dimensional image within a 3-dimensional texture.
FBOTexture2DAttachment()
Constructor.
ETex2DTarget textureTarget() const
What type of texture is expected, or for cube map textures, which face is to be attached.
Visualization Library main namespace.
FBOTexture2DAttachment(Texture *texture, int mipmap_level, ETex2DTarget target)
Constructor.
ETex2DTarget mTextureTarget
EStencilBufferFormat type() const
The type to specify when allocating the renderbuffer storage.
void setType(EColorBufferFormat type)
The type to specify when allocating the renderbuffer storage.
FBOTexture3DAttachment(Texture *texture, int mipmap_level, int layer)
FBOTextureAttachment(Texture *texture, int mipmap_level)
Constructor.
void setHandle(GLuint handle)
Sets the handle for this attachment, the handle must have been created by glGenRenderbuffers().
void setSamples(int samples)
Sets the number of samples to be specified when allocating the renderbuffer's storage.
FBOTextureLayerAttachment()
Constructor.
The base class for all the reference counted objects.
A color renderbuffer to be attached to a FramebufferObject.
A texture renderbuffer to be attached to a FramebufferObject (wraps glFramebufferTexture()).
A depth renderbuffer to be attached to a FramebufferObject.
void initStorage()
The same as calling initStorage( width(), height() )
EStencilBufferFormat mType
void setMipmapLevel(int mipmap_level)
The mipmap level of the texture to attach.
FBOAbstractTextureAttachment(Texture *texture, int mipmap_level)
Constructor.
#define VLGRAPHICS_EXPORT
int samples() const
Returns the number of samples to be used when allocating the renderbuffer's storage.
#define VL_INSTRUMENT_ABSTRACT_CLASS(ClassName, BaseClass)
A texture layer renderbuffer to be attached to a FramebufferObject (wraps glFramebufferTextureLayer()...
void setType(EStencilBufferFormat type)
The type to specify when allocating the renderbuffer storage.
Implements a framebuffer object to be used as a rendering target as specified by the ARB_framebuffer_...
void setTextureTarget(ETex2DTarget target)
What type of texture is expected, or for cube map textures, which face is to be attached.
std::set< ref< FramebufferObject > > mFramebufferObjects
int width() const
Returns the with of the renderbuffer storage.
void setLayer(int layer)
The layer of a 2-dimensional image within a 3-dimensional texture.
bool renderbufferStorageReady() const
Returns false if the renderbuffer storage needs to be created or reallocated due to a change of the s...
void setWidth(int w)
The width of the renderbuffer storage to be allocated.
The ref<> class is used to reference-count an Object.
Texture * texture()
The texture bound to this attachment.
EColorBufferFormat type() const
The type to specify when allocating the renderbuffer storage.
bool mReallocateRenderbuffer
EDepthStencilBufferFormat type() const
The type to specify when allocating the renderbuffer storage.
The Framebuffer class defines an abstract 'surface' where OpenGL can render into. ...
const std::set< ref< FramebufferObject > > & fboFramebuffers() const
Returns an std::set containing the FramebufferObject that use this FBO attachment.
virtual int internalType()
void setHandle(GLuint handle)
The handle of the framebuffer object as returned by glGenFramebuffers.
virtual GLuint handle() const
The handle of the framebuffer object as returned by glGenFramebuffers.
virtual int internalType()
void setTexture(Texture *texture)
The texture bound to this attachment.
A stencil renderbuffer to be attached to a FramebufferObject.
~FBORenderbufferAttachment()
Destructor.
FBOStencilBufferAttachment(EStencilBufferFormat type=SBF_STENCIL_INDEX8)
Constructor.