Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
The RenderTarget class defines an abstract 'surface' where OpenGL can render into. More...
#include <RenderTarget.hpp>
Public Member Functions | |
| 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, RenderTarget::handle() always returns 0, i.e., the standard OpenGL framebuffer. | |
| void | activate (EFrameBufferBind target=FBB_FRAMEBUFFER) |
| Activates the RenderTarget 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. | |
Protected Member Functions | |
| RenderTarget (OpenGLContext *ctx, int w, int h) | |
| Constructor. | |
Friends | |
| class | OpenGLContext |
The RenderTarget class defines an abstract 'surface' where OpenGL can render into.
Definition at line 49 of file RenderTarget.hpp.
| vl::RenderTarget::RenderTarget | ( | OpenGLContext * | ctx, |
| int | w, | ||
| int | h | ||
| ) | [inline, protected] |
Constructor.
Definition at line 57 of file RenderTarget.hpp.
References vl::RDB_BACK_LEFT, and VL_DEBUG_SET_OBJECT_NAME.
| OpenGLContext* vl::RenderTarget::openglContext | ( | ) | [inline] |
The OpenGLContext bound to a render target.
Definition at line 66 of file RenderTarget.hpp.
Referenced by vl::FBORenderTarget::bindFramebuffer(), vl::FBORenderTarget::checkFramebufferStatus(), vl::FBORenderTarget::create(), vl::FBORenderTarget::destroy(), vl::FBORenderTarget::removeAttachment(), vl::Renderer::render(), vl::EdgeRenderer::render(), and vl::OcclusionCullRenderer::render_pass2().
| const OpenGLContext* vl::RenderTarget::openglContext | ( | ) | const [inline] |
The OpenGLContext bound to a render target.
Definition at line 69 of file RenderTarget.hpp.
| int vl::RenderTarget::width | ( | ) | const [inline] |
The width of a render target.
Definition at line 72 of file RenderTarget.hpp.
Referenced by vl::FBORenderbufferAttachment::bindAttachment(), vl::FBOTextureLayerAttachment::bindAttachment(), vl::FBOTexture3DAttachment::bindAttachment(), vl::FBOTexture2DAttachment::bindAttachment(), vl::FBOTexture1DAttachment::bindAttachment(), vl::FBORenderTarget::bindFramebuffer(), vl::FBORenderTarget::checkFramebufferStatus(), and vl::Applet::resizeEvent().
| int vl::RenderTarget::height | ( | ) | const [inline] |
The height of a render target.
Definition at line 75 of file RenderTarget.hpp.
Referenced by vl::FBORenderbufferAttachment::bindAttachment(), vl::FBOTextureLayerAttachment::bindAttachment(), vl::FBOTexture3DAttachment::bindAttachment(), vl::FBOTexture2DAttachment::bindAttachment(), vl::FBORenderTarget::bindFramebuffer(), vl::FBORenderTarget::checkFramebufferStatus(), vl::GhostCameraManipulator::enableEvent(), vl::TrackballManipulator::mouseDownEvent(), vl::TrackballManipulator::mouseMoveEvent(), vl::GhostCameraManipulator::mouseMoveEvent(), and vl::Applet::resizeEvent().
| void vl::RenderTarget::setWidth | ( | int | width ) | [inline] |
The width of a render target.
Definition at line 78 of file RenderTarget.hpp.
Referenced by vl::FBORenderTarget::destroy(), vlWin32::Win32Window::WindowProc(), and vlEGL::EGLWindow::WindowProc().
| void vl::RenderTarget::setHeight | ( | int | height ) | [inline] |
The height of a render target.
Definition at line 81 of file RenderTarget.hpp.
Referenced by vl::FBORenderTarget::destroy(), vlWin32::Win32Window::WindowProc(), and vlEGL::EGLWindow::WindowProc().
| virtual GLuint vl::RenderTarget::handle | ( | ) | const [inline, virtual] |
The framebuffer object id as used by glBindFramebuffer, RenderTarget::handle() always returns 0, i.e., the standard OpenGL framebuffer.
Reimplemented in vl::FBORenderTarget.
Definition at line 84 of file RenderTarget.hpp.
| void vl::RenderTarget::activate | ( | EFrameBufferBind | target = FBB_FRAMEBUFFER ) |
[inline] |
Activates the RenderTarget by calling bindFramebuffer() and bindDrawBuffers()
Definition at line 87 of file RenderTarget.hpp.
Referenced by vl::BlitFramebuffer::copyPixels().
| virtual void vl::RenderTarget::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::FBORenderTarget.
Definition at line 96 of file RenderTarget.hpp.
References VL_CHECK_OGL.
| void RenderTarget::bindReadBuffer | ( | ) |
Binds to the currently active framebuffer object (including the 0 one) the read buffer specified by setReadBuffer().
Definition at line 159 of file RenderTarget.cpp.
References readBuffer(), and VL_CHECK_OGL.
Referenced by vl::FBORenderTarget::bindFramebuffer().
| void RenderTarget::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 RenderTarget.cpp.
References checkDrawBuffers(), vl::Log::error(), vl::Has_GL_Version_2_0, VL_CHECK, and VL_CHECK_OGL.
Referenced by vl::FBORenderTarget::bindFramebuffer().
| bool RenderTarget::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 RenderTarget.cpp.
References vl::Log::error().
Referenced by bindDrawBuffers().
| void vl::RenderTarget::setDrawBuffer | ( | EReadDrawBuffer | draw_buffer ) | [inline] |
Specifies the color buffer to be drawn into.
Definition at line 124 of file RenderTarget.hpp.
| void vl::RenderTarget::setDrawBuffers | ( | EReadDrawBuffer | draw_buffer1, |
| EReadDrawBuffer | draw_buffer2 | ||
| ) | [inline] |
Specifies a list of color buffers to be drawn into.
Definition at line 131 of file RenderTarget.hpp.
| void vl::RenderTarget::setDrawBuffers | ( | EReadDrawBuffer | draw_buffer1, |
| EReadDrawBuffer | draw_buffer2, | ||
| EReadDrawBuffer | draw_buffer3 | ||
| ) | [inline] |
Specifies a list of color buffers to be drawn into.
Definition at line 139 of file RenderTarget.hpp.
| void vl::RenderTarget::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 148 of file RenderTarget.hpp.
| void vl::RenderTarget::setDrawBuffers | ( | const std::vector< EReadDrawBuffer > & | draw_buffers ) | [inline] |
Specifies a list of color buffers to be drawn into.
Definition at line 158 of file RenderTarget.hpp.
| const std::vector< EReadDrawBuffer >& vl::RenderTarget::drawBuffers | ( | ) | [inline] |
The color buffers to be drawn into.
Definition at line 161 of file RenderTarget.hpp.
| EReadDrawBuffer vl::RenderTarget::readBuffer | ( | ) | const [inline] |
The read-buffer bound when the render target is activated.
Definition at line 164 of file RenderTarget.hpp.
Referenced by bindReadBuffer().
| void vl::RenderTarget::setReadBuffer | ( | EReadDrawBuffer | read_buffer ) | [inline] |
The read-buffer bound when the render target is activated.
Definition at line 167 of file RenderTarget.hpp.
friend class OpenGLContext [friend] |
Reimplemented in vl::FBORenderTarget.
Definition at line 53 of file RenderTarget.hpp.