Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The Framebuffer class defines an abstract 'surface' where OpenGL can render into. More...
#include <Framebuffer.hpp>
Public Member Functions | |
Framebuffer (OpenGLContext *ctx, int w, int h, EReadDrawBuffer draw_buffer, EReadDrawBuffer read_buffer) | |
Constructor, see also OpenGLContext::framebuffer(). More... | |
OpenGLContext * | openglContext () |
The OpenGLContext bound to a render target. More... | |
const OpenGLContext * | openglContext () const |
The OpenGLContext bound to a render target. More... | |
int | width () const |
The width of a render target. More... | |
int | height () const |
The height of a render target. More... | |
void | setWidth (int width) |
The width of a render target. More... | |
void | setHeight (int height) |
The height of a render target. More... | |
virtual GLuint | handle () const |
The framebuffer object id as used by glBindFramebuffer, Framebuffer::handle() always returns 0, i.e., the standard OpenGL framebuffer. More... | |
void | activate (EFramebufferBind target=FBB_FRAMEBUFFER) |
Activates the Framebuffer by calling bindFramebuffer() and bindDrawBuffers() More... | |
virtual void | bindFramebuffer (EFramebufferBind target=FBB_FRAMEBUFFER) |
Calls glBindFramebuffer(target, 0) thus activating the the framebuffer 0, that is, the normal OpenGL buffers. More... | |
void | bindReadBuffer () |
Binds to the currently active framebuffer object (including the 0 one) the read buffer specified by setReadBuffer(). More... | |
void | bindDrawBuffers () const |
Binds to the currently active framebuffer object (including the 0 one) the draw buffers specified by setDrawBuffers(). More... | |
bool | checkDrawBuffers () const |
Returns true if the draw buffers bound to this render target are legal for this render target type. More... | |
void | setDrawBuffer (EReadDrawBuffer draw_buffer) |
Specifies the color buffer to be drawn into. More... | |
void | setDrawBuffers (EReadDrawBuffer draw_buffer1, EReadDrawBuffer draw_buffer2) |
Specifies a list of color buffers to be drawn into. More... | |
void | setDrawBuffers (EReadDrawBuffer draw_buffer1, EReadDrawBuffer draw_buffer2, EReadDrawBuffer draw_buffer3) |
Specifies a list of color buffers to be drawn into. More... | |
void | setDrawBuffers (EReadDrawBuffer draw_buffer1, EReadDrawBuffer draw_buffer2, EReadDrawBuffer draw_buffer3, EReadDrawBuffer draw_buffer4) |
Specifies a list of color buffers to be drawn into. More... | |
void | setDrawBuffers (const std::vector< EReadDrawBuffer > &draw_buffers) |
Specifies a list of color buffers to be drawn into. More... | |
const std::vector< EReadDrawBuffer > & | drawBuffers () |
The color buffers to be drawn into. More... | |
EReadDrawBuffer | readBuffer () const |
The read-buffer bound when the render target is activated. More... | |
void | setReadBuffer (EReadDrawBuffer read_buffer) |
The read-buffer bound when the render target is activated. 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... | |
Object & | operator= (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... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () 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... | |
Friends | |
class | OpenGLContext |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
The Framebuffer class defines an abstract 'surface' where OpenGL can render into.
Definition at line 49 of file Framebuffer.hpp.
|
inline |
Constructor, see also OpenGLContext::framebuffer().
Definition at line 57 of file Framebuffer.hpp.
|
inline |
Activates the Framebuffer by calling bindFramebuffer() and bindDrawBuffers()
Definition at line 87 of file Framebuffer.hpp.
Referenced by vl::BlitFramebuffer::copyPixels(), vl::Renderer::render(), and vl::EdgeRenderer::render().
void Framebuffer::bindDrawBuffers | ( | ) | const |
Binds to the currently active framebuffer object (including the 0 one) the draw buffers specified by setDrawBuffers().
Definition at line 131 of file Framebuffer.cpp.
References checkDrawBuffers(), vl::Log::error(), vl::Has_GL_Version_2_0, VL_CHECK, and VL_CHECK_OGL.
|
inlinevirtual |
Calls glBindFramebuffer(target, 0) thus activating the the framebuffer 0, that is, the normal OpenGL buffers.
Reimplemented in vl::FramebufferObject.
Definition at line 96 of file Framebuffer.hpp.
References vl::FBB_DRAW_FRAMEBUFFER, vl::FBB_FRAMEBUFFER, vl::FBB_READ_FRAMEBUFFER, and VL_CHECK_OGL.
void Framebuffer::bindReadBuffer | ( | ) |
Binds to the currently active framebuffer object (including the 0 one) the read buffer specified by setReadBuffer().
Definition at line 159 of file Framebuffer.cpp.
References readBuffer(), and VL_CHECK_OGL.
bool Framebuffer::checkDrawBuffers | ( | ) | const |
Returns true
if the draw buffers bound to this render target are legal for this render target type.
Definition at line 44 of file Framebuffer.cpp.
References vl::Log::error().
Referenced by bindDrawBuffers().
|
inline |
The color buffers to be drawn into.
Definition at line 165 of file Framebuffer.hpp.
|
inlinevirtual |
The framebuffer object id as used by glBindFramebuffer, Framebuffer::handle() always returns 0, i.e., the standard OpenGL framebuffer.
Reimplemented in vl::FramebufferObject.
Definition at line 84 of file Framebuffer.hpp.
|
inline |
The height of a render target.
Definition at line 75 of file Framebuffer.hpp.
Referenced by vl::FBORenderbufferAttachment::bindAttachment(), vl::FBOTexture2DAttachment::bindAttachment(), vl::FBOTexture3DAttachment::bindAttachment(), vl::FBOTextureLayerAttachment::bindAttachment(), vl::GhostCameraManipulator::enableEvent(), vl::TrackballManipulator::mouseDownEvent(), vl::GhostCameraManipulator::mouseMoveEvent(), vl::TrackballManipulator::mouseMoveEvent(), and vl::Applet::resizeEvent().
|
inline |
The OpenGLContext bound to a render target.
Definition at line 66 of file Framebuffer.hpp.
Referenced by vl::Renderer::render(), vl::EdgeRenderer::render(), vl::OcclusionCullRenderer::render_pass2(), vl::EdgeRenderer::renderLines(), vl::Renderer::renderRaw(), and vl::EdgeRenderer::renderSolids().
|
inline |
The OpenGLContext bound to a render target.
Definition at line 69 of file Framebuffer.hpp.
|
inline |
The read-buffer bound when the render target is activated.
Definition at line 168 of file Framebuffer.hpp.
Referenced by bindReadBuffer().
|
inline |
Specifies the color buffer to be drawn into.
Definition at line 128 of file Framebuffer.hpp.
|
inline |
Specifies a list of color buffers to be drawn into.
Definition at line 135 of file Framebuffer.hpp.
|
inline |
Specifies a list of color buffers to be drawn into.
Definition at line 143 of file Framebuffer.hpp.
|
inline |
Specifies a list of color buffers to be drawn into.
Definition at line 152 of file Framebuffer.hpp.
|
inline |
Specifies a list of color buffers to be drawn into.
Definition at line 162 of file Framebuffer.hpp.
|
inline |
The height of a render target.
Definition at line 81 of file Framebuffer.hpp.
Referenced by vlGLUT::GLUTWindow::glut_reshape_func(), vlWin32::Win32Window::WindowProc(), and vlEGL::EGLWindow::WindowProc().
|
inline |
The read-buffer bound when the render target is activated.
Definition at line 171 of file Framebuffer.hpp.
|
inline |
The width of a render target.
Definition at line 78 of file Framebuffer.hpp.
Referenced by vlGLUT::GLUTWindow::glut_reshape_func(), vlWin32::Win32Window::WindowProc(), and vlEGL::EGLWindow::WindowProc().
|
inline |
The width of a render target.
Definition at line 72 of file Framebuffer.hpp.
Referenced by vl::FBORenderbufferAttachment::bindAttachment(), vl::FBOTexture1DAttachment::bindAttachment(), vl::FBOTexture2DAttachment::bindAttachment(), vl::FBOTexture3DAttachment::bindAttachment(), vl::FBOTextureLayerAttachment::bindAttachment(), and vl::Applet::resizeEvent().
|
friend |
Definition at line 53 of file Framebuffer.hpp.
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:08.
© Copyright Michele Bosi. All rights reserved.