Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The Clear class is a Renderable used to clear the whole or a portion of the color, stencil or depth buffer. More...
#include <Clear.hpp>
Public Member Functions | |
Clear () | |
virtual void | render_Implementation (const Actor *, const Shader *, const Camera *, OpenGLContext *) const |
void | setClearColorBuffer (bool clear) |
void | setClearDepthBuffer (bool clear) |
void | setClearStencilBuffer (bool clear) |
void | setClearColorValue (const fvec4 &clear_val) |
void | setClearColorValueInt (const ivec4 &clear_val) |
void | setClearColorValueUInt (const uvec4 &clear_val) |
void | setClearDepthValue (float clear_val) |
void | setClearStencilValue (int clear_val) |
void | setClearColorMode (EClearColorMode mode) |
EClearColorMode | clearColorMode () const |
void | setScissorBox (int x, int y, int w, int h) |
Defines which portion of the rendering buffers should be cleared. | |
void | getScissorBox (int &x, int &y, int &w, int &h) |
virtual void | updateDirtyBufferObject (EBufferObjectUpdateMode) |
Uploads the data stored in the local buffers on the GPU memory. | |
virtual void | deleteBufferObject () |
Destroys the BufferObject (vertex buffer objects) associated to this a Renderable. | |
Protected Member Functions | |
virtual void | computeBounds_Implementation () |
Protected Attributes | |
fvec4 | mClearColorValue |
ivec4 | mClearColorValueInt |
uvec4 | mClearColorValueUInt |
int | mScissorBox [4] |
EClearColorMode | mClearColorMode |
float | mClearDepthValue |
int | mClearStencilValue |
bool | mClearColorBuffer |
bool | mClearDepthBuffer |
bool | mClearStencilBuffer |
The Clear class is a Renderable used to clear the whole or a portion of the color, stencil or depth buffer.
The Clear class is a special Renderable that wraps the functionalities of the following OpenGL functions:
Usually the color, depth and stencil buffers are cleared at the beginning of a rendering when the Viewport is initialized. To handle less common cases the Clear class allows you to perform a clear operation also in the middle of a rendering. Just bind it to an an Actor and setup the appropriate clearing options.
Definition at line 69 of file Clear.hpp.
Clear::Clear | ( | ) |
Definition at line 40 of file Clear.cpp.
References mScissorBox, and VL_DEBUG_SET_OBJECT_NAME.
void Clear::render_Implementation | ( | const Actor * | , |
const Shader * | , | ||
const Camera * | camera, | ||
OpenGLContext * | |||
) | const [virtual] |
Implements vl::Renderable.
Definition at line 51 of file Clear.cpp.
References vl::Vector4< T_Scalar >::a(), vl::Vector4< T_Scalar >::b(), vl::CCM_Float, vl::CCM_Int, vl::CCM_UInt, clearColorMode(), vl::Log::error(), vl::Vector4< T_Scalar >::g(), vl::Viewport::height(), mClearColorBuffer, mClearColorValue, mClearColorValueInt, mClearColorValueUInt, mClearDepthBuffer, mClearDepthValue, mClearStencilBuffer, mClearStencilValue, mScissorBox, vl::Vector4< T_Scalar >::r(), vl::Camera::viewport(), VL_CHECK_OGL, vl::Viewport::width(), vl::Viewport::x(), and vl::Viewport::y().
void vl::Clear::setClearColorBuffer | ( | bool | clear ) | [inline] |
void vl::Clear::setClearDepthBuffer | ( | bool | clear ) | [inline] |
void vl::Clear::setClearStencilBuffer | ( | bool | clear ) | [inline] |
void vl::Clear::setClearColorValue | ( | const fvec4 & | clear_val ) | [inline] |
void vl::Clear::setClearColorValueInt | ( | const ivec4 & | clear_val ) | [inline] |
void vl::Clear::setClearColorValueUInt | ( | const uvec4 & | clear_val ) | [inline] |
void vl::Clear::setClearDepthValue | ( | float | clear_val ) | [inline] |
void vl::Clear::setClearStencilValue | ( | int | clear_val ) | [inline] |
void vl::Clear::setClearColorMode | ( | EClearColorMode | mode ) | [inline] |
EClearColorMode vl::Clear::clearColorMode | ( | ) | const [inline] |
Definition at line 96 of file Clear.hpp.
Referenced by render_Implementation().
void vl::Clear::setScissorBox | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) | [inline] |
Defines which portion of the rendering buffers should be cleared.
The parameters 'x', 'y', 'z', 'w' specify a rectangular area in viewport coordinates. Such area is also clipped against the viewport borders. If 'w' or 'h' are set to -1 then the whole viewport is cleared.
void vl::Clear::getScissorBox | ( | int & | x, |
int & | y, | ||
int & | w, | ||
int & | h | ||
) | [inline] |
virtual void vl::Clear::updateDirtyBufferObject | ( | EBufferObjectUpdateMode | ) | [inline, virtual] |
Uploads the data stored in the local buffers on the GPU memory.
If 'discard_local_data' is set to true
the memory used by the local buffers is released.
Implements vl::Renderable.
virtual void vl::Clear::deleteBufferObject | ( | ) | [inline, virtual] |
Destroys the BufferObject (vertex buffer objects) associated to this a Renderable.
Implements vl::Renderable.
virtual void vl::Clear::computeBounds_Implementation | ( | ) | [inline, protected, virtual] |
Implements vl::Renderable.
fvec4 vl::Clear::mClearColorValue [protected] |
Definition at line 116 of file Clear.hpp.
Referenced by render_Implementation().
ivec4 vl::Clear::mClearColorValueInt [protected] |
Definition at line 117 of file Clear.hpp.
Referenced by render_Implementation().
uvec4 vl::Clear::mClearColorValueUInt [protected] |
Definition at line 118 of file Clear.hpp.
Referenced by render_Implementation().
int vl::Clear::mScissorBox[4] [protected] |
Definition at line 119 of file Clear.hpp.
Referenced by Clear(), and render_Implementation().
EClearColorMode vl::Clear::mClearColorMode [protected] |
float vl::Clear::mClearDepthValue [protected] |
Definition at line 121 of file Clear.hpp.
Referenced by render_Implementation().
int vl::Clear::mClearStencilValue [protected] |
Definition at line 122 of file Clear.hpp.
Referenced by render_Implementation().
bool vl::Clear::mClearColorBuffer [protected] |
Definition at line 123 of file Clear.hpp.
Referenced by render_Implementation().
bool vl::Clear::mClearDepthBuffer [protected] |
Definition at line 124 of file Clear.hpp.
Referenced by render_Implementation().
bool vl::Clear::mClearStencilBuffer [protected] |
Definition at line 125 of file Clear.hpp.
Referenced by render_Implementation().