Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
An abstract class that represents all the objects that can be rendered. More...
#include <Renderable.hpp>
Public Member Functions | |
Renderable () | |
Constructor. | |
virtual | ~Renderable () |
Destructor. | |
void | render (const Actor *actor, const Shader *shader, const Camera *camera, OpenGLContext *gl_context) |
Renders the Renderable and if necessary compiles the display list and updates the BufferObjects. | |
void | computeBounds () |
Recomputes the bounding box and bounding sphere of a Renderable. | |
long long | boundsUpdateTick () const |
Returns the bounds-update-tick which is a counter incremented every time the bounding box or bounding sphere is updated. | |
void | setBoundsDirty (bool dirty) |
Marks the bounding box and bounding sphere as dirty in order to be recomputed at the next rendering. | |
bool | boundsDirty () const |
Returns whether the bounding sphere or bounding box are "dirty", that is, meant to be recomputed. | |
void | setBoundingBox (const AABB &aabb) |
Sets the bounding box of a Renderable. | |
void | setBoundingSphere (const Sphere &sphere) |
Sets the bounding sphere of a Renderable. | |
const AABB & | boundingBox () const |
Returns the bounding box of a Renderable without recomputing the bounds if dirty. | |
const Sphere & | boundingSphere () const |
Returns the bounding sphere of a Renderable without recomputing the bounds if dirty. | |
const AABB & | boundingBox () |
Returns the bounding box of a Renderable recomputing the bounds if dirty. | |
const Sphere & | boundingSphere () |
Returns the bounding sphere of a Renderable recomputing the bounds if dirty. | |
unsigned int | displayList () const |
Returns the display list associated to a Renderable or 0 (zero) if no display list is associated. | |
void | setDisplayList (unsigned int disp_list) |
Manually assciates a display list to a Renderable (to be used with care). | |
bool | isDisplayListEnabled () const |
Returns true if display lists are enabled for a Renderable (disabled by default). | |
void | setDisplayListEnabled (bool enabled) |
Enable/disable display lists (disabled by default). | |
bool | displayListDirty () const |
Whether the display list associated to a Renderable should be recompiled at the next rendering. | |
void | setDisplayListDirty (bool dirty) |
Whether the display list associated to a Renderable should be recompiled at the next rendering. | |
bool | isBufferObjectEnabled () const |
Returns true if BufferObject (vertex buffer object) are enabled for a Renderable (enabled by default). | |
void | setBufferObjectEnabled (bool enabled) |
Enable/disable BufferObject (vertex buffer object) (enabled by default). | |
bool | isBufferObjectDirty () const |
Whether BufferObjects associated to a Renderable should be recomputed on the next rendering. | |
void | setBufferObjectDirty (bool dirty) |
Whether BufferObjects associated to a Renderable should be recomputed on the next rendering. | |
virtual void | updateDirtyBufferObject (EBufferObjectUpdateMode)=0 |
Uploads the data stored in the local buffers on the GPU memory. | |
virtual void | deleteBufferObject ()=0 |
Destroys the BufferObject (vertex buffer objects) associated to this a Renderable. | |
void | deleteDisplayList () |
Deletes the display list currently associated to a Renderable. | |
Protected Member Functions | |
virtual void | computeBounds_Implementation ()=0 |
virtual void | render_Implementation (const Actor *actor, const Shader *shader, const Camera *camera, OpenGLContext *gl_context) const =0 |
An abstract class that represents all the objects that can be rendered.
In order to render a Renderable you have to bind it to an Actor. An Actor glues together a Renderable, an Effect and eventually a Transform. Note that the same Renderable can be associated to more than one Actor.
Definition at line 58 of file Renderable.hpp.
vl::Renderable::Renderable | ( | ) | [inline] |
Constructor.
Definition at line 69 of file Renderable.hpp.
virtual vl::Renderable::~Renderable | ( | ) | [inline, virtual] |
Destructor.
Definition at line 73 of file Renderable.hpp.
void vl::Renderable::render | ( | const Actor * | actor, |
const Shader * | shader, | ||
const Camera * | camera, | ||
OpenGLContext * | gl_context | ||
) | [inline] |
Renders the Renderable and if necessary compiles the display list and updates the BufferObjects.
Definition at line 76 of file Renderable.hpp.
References vl::BUM_KeepRamBuffer, VL_CHECK, and VL_CHECK_OGL.
Referenced by vl::Renderer::render().
void vl::Renderable::computeBounds | ( | ) | [inline] |
Recomputes the bounding box and bounding sphere of a Renderable.
Definition at line 117 of file Renderable.hpp.
long long vl::Renderable::boundsUpdateTick | ( | ) | const [inline] |
Returns the bounds-update-tick which is a counter incremented every time the bounding box or bounding sphere is updated.
Definition at line 120 of file Renderable.hpp.
Referenced by vl::Actor::boundsDirty(), and vl::Actor::computeBounds().
void vl::Renderable::setBoundsDirty | ( | bool | dirty ) | [inline] |
Marks the bounding box and bounding sphere as dirty in order to be recomputed at the next rendering.
Definition at line 123 of file Renderable.hpp.
bool vl::Renderable::boundsDirty | ( | ) | const [inline] |
Returns whether the bounding sphere or bounding box are "dirty", that is, meant to be recomputed.
Definition at line 126 of file Renderable.hpp.
Referenced by vl::Actor::boundsDirty(), vl::Actor::computeBounds(), and vl::VLXClassWrapper_Renderable::exportRenderable().
void vl::Renderable::setBoundingBox | ( | const AABB & | aabb ) | [inline] |
Sets the bounding box of a Renderable.
Definition at line 129 of file Renderable.hpp.
Referenced by vl::Geometry::computeBounds_Implementation(), and vl::VLXClassWrapper_Renderable::importRenderable().
void vl::Renderable::setBoundingSphere | ( | const Sphere & | sphere ) | [inline] |
Sets the bounding sphere of a Renderable.
Definition at line 140 of file Renderable.hpp.
Referenced by vl::Geometry::computeBounds_Implementation(), and vl::VLXClassWrapper_Renderable::importRenderable().
const AABB& vl::Renderable::boundingBox | ( | ) | const [inline] |
Returns the bounding box of a Renderable without recomputing the bounds if dirty.
Definition at line 151 of file Renderable.hpp.
References vl::Log::warning().
Referenced by vl::Actor::computeBounds(), vl::PixelLODEvaluator::evaluate(), vl::DistanceLODEvaluator::evaluate(), vl::VLXClassWrapper_Renderable::exportRenderable(), vl::OcclusionCullRenderer::render_pass2(), and vl::RenderQueue::sort().
const Sphere& vl::Renderable::boundingSphere | ( | ) | const [inline] |
Returns the bounding sphere of a Renderable without recomputing the bounds if dirty.
Definition at line 159 of file Renderable.hpp.
References vl::Log::warning().
Referenced by vl::VLXClassWrapper_Renderable::exportRenderable().
const AABB& vl::Renderable::boundingBox | ( | ) | [inline] |
Returns the bounding box of a Renderable recomputing the bounds if dirty.
Definition at line 167 of file Renderable.hpp.
const Sphere& vl::Renderable::boundingSphere | ( | ) | [inline] |
Returns the bounding sphere of a Renderable recomputing the bounds if dirty.
Definition at line 175 of file Renderable.hpp.
unsigned int vl::Renderable::displayList | ( | ) | const [inline] |
Returns the display list associated to a Renderable or 0 (zero) if no display list is associated.
Definition at line 183 of file Renderable.hpp.
void vl::Renderable::setDisplayList | ( | unsigned int | disp_list ) | [inline] |
Manually assciates a display list to a Renderable (to be used with care).
Definition at line 186 of file Renderable.hpp.
bool vl::Renderable::isDisplayListEnabled | ( | ) | const [inline] |
Returns true
if display lists are enabled for a Renderable (disabled by default).
Definition at line 189 of file Renderable.hpp.
Referenced by vl::VLXClassWrapper_Renderable::exportRenderable(), and vl::Geometry::render_Implementation().
void vl::Renderable::setDisplayListEnabled | ( | bool | enabled ) | [inline] |
Enable/disable display lists (disabled by default).
Definition at line 192 of file Renderable.hpp.
Referenced by vl::VLXClassWrapper_Renderable::importRenderable().
bool vl::Renderable::displayListDirty | ( | ) | const [inline] |
Whether the display list associated to a Renderable should be recompiled at the next rendering.
Definition at line 195 of file Renderable.hpp.
void vl::Renderable::setDisplayListDirty | ( | bool | dirty ) | [inline] |
Whether the display list associated to a Renderable should be recompiled at the next rendering.
Definition at line 198 of file Renderable.hpp.
Referenced by vl::DepthSortCallback::onActorRenderStarted().
bool vl::Renderable::isBufferObjectEnabled | ( | ) | const [inline] |
Returns true
if BufferObject (vertex buffer object) are enabled for a Renderable (enabled by default).
Definition at line 201 of file Renderable.hpp.
Referenced by vl::VLXClassWrapper_Renderable::exportRenderable(), and vl::Geometry::render_Implementation().
void vl::Renderable::setBufferObjectEnabled | ( | bool | enabled ) | [inline] |
Enable/disable BufferObject (vertex buffer object) (enabled by default).
Definition at line 204 of file Renderable.hpp.
Referenced by vl::VLXClassWrapper_Renderable::importRenderable().
bool vl::Renderable::isBufferObjectDirty | ( | ) | const [inline] |
Whether BufferObjects associated to a Renderable should be recomputed on the next rendering.
Definition at line 207 of file Renderable.hpp.
void vl::Renderable::setBufferObjectDirty | ( | bool | dirty ) | [inline] |
Whether BufferObjects associated to a Renderable should be recomputed on the next rendering.
Definition at line 210 of file Renderable.hpp.
Referenced by vl::Geometry::clearArrays(), and vl::DepthSortCallback::onActorRenderStarted().
virtual void vl::Renderable::updateDirtyBufferObject | ( | EBufferObjectUpdateMode | ) | [pure 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.
Implemented in vl::Clear, vl::CoreText, vl::DrawPixels, vl::Geometry, and vl::Text.
virtual void vl::Renderable::deleteBufferObject | ( | ) | [pure virtual] |
Destroys the BufferObject (vertex buffer objects) associated to this a Renderable.
Implemented in vl::Clear, vl::CoreText, vl::DrawPixels, vl::Geometry, and vl::Text.
void vl::Renderable::deleteDisplayList | ( | ) | [inline] |
Deletes the display list currently associated to a Renderable.
Definition at line 221 of file Renderable.hpp.
virtual void vl::Renderable::computeBounds_Implementation | ( | ) | [protected, pure virtual] |
Implemented in vl::Clear, vl::CoreText, vl::DrawPixels, vl::Geometry, and vl::Text.
virtual void vl::Renderable::render_Implementation | ( | const Actor * | actor, |
const Shader * | shader, | ||
const Camera * | camera, | ||
OpenGLContext * | gl_context | ||
) | const [protected, pure virtual] |
Implemented in vl::Clear, vl::CoreText, vl::DrawPixels, vl::Geometry, and vl::Text.