Visualization Library v1.0.3A 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(). | |
| OpenGLContext * | openglContext () |
| The OpenGLContext bound to a render target. | |
| const OpenGLContext * | openglContext () const |
| The OpenGLContext bound to a render target. | |
| int | width () const |
| The width of a render target. | |
| int | height () const |
| The height of a render target. | |
| void | setWidth (int width) |
| The width of a render target. | |
| void | setHeight (int height) |
| The height of a render target. | |
| virtual GLuint | handle () const |
| The framebuffer object id as used by glBindFramebuffer, Framebuffer::handle() always returns 0, i.e., the standard OpenGL framebuffer. | |
| void | activate (EFramebufferBind target=FBB_FRAMEBUFFER) |
| Activates the Framebuffer by calling bindFramebuffer() and bindDrawBuffers() | |
| virtual void | bindFramebuffer (EFramebufferBind target=FBB_FRAMEBUFFER) |
| Calls glBindFramebuffer(target, 0) thus activating the the framebuffer 0, that is, the normal OpenGL buffers. | |
| void | bindReadBuffer () |
| Binds to the currently active framebuffer object (including the 0 one) the read buffer specified by setReadBuffer(). | |
| void | bindDrawBuffers () const |
| Binds to the currently active framebuffer object (including the 0 one) the draw buffers specified by setDrawBuffers(). | |
| bool | checkDrawBuffers () const |
Returns true if the draw buffers bound to this render target are legal for this render target type. | |
| void | setDrawBuffer (EReadDrawBuffer draw_buffer) |
| Specifies the color buffer to be drawn into. | |
| void | setDrawBuffers (EReadDrawBuffer draw_buffer1, EReadDrawBuffer draw_buffer2) |
| Specifies a list of color buffers to be drawn into. | |
| void | setDrawBuffers (EReadDrawBuffer draw_buffer1, EReadDrawBuffer draw_buffer2, EReadDrawBuffer draw_buffer3) |
| Specifies a list of color buffers to be drawn into. | |
| void | setDrawBuffers (EReadDrawBuffer draw_buffer1, EReadDrawBuffer draw_buffer2, EReadDrawBuffer draw_buffer3, EReadDrawBuffer draw_buffer4) |
| Specifies a list of color buffers to be drawn into. | |
| void | setDrawBuffers (const std::vector< EReadDrawBuffer > &draw_buffers) |
| Specifies a list of color buffers to be drawn into. | |
| const std::vector < EReadDrawBuffer > & | drawBuffers () |
| The color buffers to be drawn into. | |
| EReadDrawBuffer | readBuffer () const |
| The read-buffer bound when the render target is activated. | |
| void | setReadBuffer (EReadDrawBuffer read_buffer) |
| The read-buffer bound when the render target is activated. | |
Friends | |
| class | OpenGLContext |
The Framebuffer class defines an abstract 'surface' where OpenGL can render into.
Definition at line 49 of file Framebuffer.hpp.
| vl::Framebuffer::Framebuffer | ( | OpenGLContext * | ctx, |
| int | w, | ||
| int | h, | ||
| EReadDrawBuffer | draw_buffer, | ||
| EReadDrawBuffer | read_buffer | ||
| ) | [inline] |
Constructor, see also OpenGLContext::framebuffer().
Definition at line 57 of file Framebuffer.hpp.
References VL_DEBUG_SET_OBJECT_NAME.
| OpenGLContext* vl::Framebuffer::openglContext | ( | ) | [inline] |
The OpenGLContext bound to a render target.
Definition at line 66 of file Framebuffer.hpp.
Referenced by vl::FramebufferObject::bindFramebuffer(), vl::FramebufferObject::checkFramebufferStatus(), vl::FramebufferObject::createFBO(), vl::FramebufferObject::deleteFBO(), vl::FramebufferObject::removeAttachment(), vl::Renderer::render(), vl::EdgeRenderer::render(), vl::OcclusionCullRenderer::render_pass2(), vl::EdgeRenderer::renderLines(), and vl::EdgeRenderer::renderSolids().
| const OpenGLContext* vl::Framebuffer::openglContext | ( | ) | const [inline] |
The OpenGLContext bound to a render target.
Definition at line 69 of file Framebuffer.hpp.
| int vl::Framebuffer::width | ( | ) | const [inline] |
The width of a render target.
Definition at line 72 of file Framebuffer.hpp.
Referenced by vl::FBORenderbufferAttachment::bindAttachment(), vl::FBOTextureLayerAttachment::bindAttachment(), vl::FBOTexture3DAttachment::bindAttachment(), vl::FBOTexture2DAttachment::bindAttachment(), vl::FBOTexture1DAttachment::bindAttachment(), vl::FramebufferObject::bindFramebuffer(), vl::FramebufferObject::checkFramebufferStatus(), and vl::Applet::resizeEvent().
| int vl::Framebuffer::height | ( | ) | const [inline] |
The height of a render target.
Definition at line 75 of file Framebuffer.hpp.
Referenced by vl::FBORenderbufferAttachment::bindAttachment(), vl::FBOTextureLayerAttachment::bindAttachment(), vl::FBOTexture3DAttachment::bindAttachment(), vl::FBOTexture2DAttachment::bindAttachment(), vl::FramebufferObject::bindFramebuffer(), vl::FramebufferObject::checkFramebufferStatus(), vl::GhostCameraManipulator::enableEvent(), vl::TrackballManipulator::mouseDownEvent(), vl::TrackballManipulator::mouseMoveEvent(), vl::GhostCameraManipulator::mouseMoveEvent(), and vl::Applet::resizeEvent().
| void vl::Framebuffer::setWidth | ( | int | width ) | [inline] |
The width of a render target.
Definition at line 78 of file Framebuffer.hpp.
Referenced by vl::FramebufferObject::deleteFBO(), vlWin32::Win32Window::WindowProc(), and vlEGL::EGLWindow::WindowProc().
| void vl::Framebuffer::setHeight | ( | int | height ) | [inline] |
The height of a render target.
Definition at line 81 of file Framebuffer.hpp.
Referenced by vl::FramebufferObject::deleteFBO(), vlWin32::Win32Window::WindowProc(), and vlEGL::EGLWindow::WindowProc().
| virtual GLuint vl::Framebuffer::handle | ( | ) | const [inline, virtual] |
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.
| void vl::Framebuffer::activate | ( | EFramebufferBind | target = FBB_FRAMEBUFFER ) |
[inline] |
Activates the Framebuffer by calling bindFramebuffer() and bindDrawBuffers()
Definition at line 87 of file Framebuffer.hpp.
Referenced by vl::BlitFramebuffer::copyPixels().
| virtual void vl::Framebuffer::bindFramebuffer | ( | EFramebufferBind | target = FBB_FRAMEBUFFER ) |
[inline, virtual] |
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.
Referenced by vl::FramebufferObject::bindFramebuffer().
| 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.
Referenced by vl::FramebufferObject::bindFramebuffer().
| 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().
| void vl::Framebuffer::setDrawBuffer | ( | EReadDrawBuffer | draw_buffer ) | [inline] |
Specifies the color buffer to be drawn into.
Definition at line 128 of file Framebuffer.hpp.
| void vl::Framebuffer::setDrawBuffers | ( | EReadDrawBuffer | draw_buffer1, |
| EReadDrawBuffer | draw_buffer2 | ||
| ) | [inline] |
Specifies a list of color buffers to be drawn into.
Definition at line 135 of file Framebuffer.hpp.
| void vl::Framebuffer::setDrawBuffers | ( | EReadDrawBuffer | draw_buffer1, |
| EReadDrawBuffer | draw_buffer2, | ||
| EReadDrawBuffer | draw_buffer3 | ||
| ) | [inline] |
Specifies a list of color buffers to be drawn into.
Definition at line 143 of file Framebuffer.hpp.
| void vl::Framebuffer::setDrawBuffers | ( | EReadDrawBuffer | draw_buffer1, |
| EReadDrawBuffer | draw_buffer2, | ||
| EReadDrawBuffer | draw_buffer3, | ||
| EReadDrawBuffer | draw_buffer4 | ||
| ) | [inline] |
Specifies a list of color buffers to be drawn into.
Definition at line 152 of file Framebuffer.hpp.
| void vl::Framebuffer::setDrawBuffers | ( | const std::vector< EReadDrawBuffer > & | draw_buffers ) | [inline] |
Specifies a list of color buffers to be drawn into.
Definition at line 162 of file Framebuffer.hpp.
| const std::vector< EReadDrawBuffer >& vl::Framebuffer::drawBuffers | ( | ) | [inline] |
The color buffers to be drawn into.
Definition at line 165 of file Framebuffer.hpp.
| EReadDrawBuffer vl::Framebuffer::readBuffer | ( | ) | const [inline] |
The read-buffer bound when the render target is activated.
Definition at line 168 of file Framebuffer.hpp.
Referenced by bindReadBuffer().
| void vl::Framebuffer::setReadBuffer | ( | EReadDrawBuffer | read_buffer ) | [inline] |
The read-buffer bound when the render target is activated.
Definition at line 171 of file Framebuffer.hpp.
friend class OpenGLContext [friend] |
Reimplemented in vl::FramebufferObject.
Definition at line 53 of file Framebuffer.hpp.