Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Wraps the OpenGL function glDrawPixels(). More...
#include <DrawPixels.hpp>
Classes | |
class | Pixels |
Represents a bitmap to be drawn on the screen. More... | |
Public Member Functions | |
DrawPixels () | |
void | computeBounds_Implementation () |
void | render_Implementation (const Actor *actor, const Shader *shader, const Camera *camera, OpenGLContext *gl_context) const |
Renders the bitamps. | |
const Collection< Pixels > * | draws () const |
Collection< Pixels > * | draws () |
void | deletePixelBufferObjects () |
deallocate PBOs | |
void | releaseImages () |
Iterates on the Pixels objects and sets their Image references to NULL. | |
bool | generatePixelBufferObjects (EBufferObjectUsage usage, bool discard_local_storage) |
generates PBOs only for Pixels objects without a PBO handle | |
void | setUsePixelBufferObject (bool use_pbo) |
bool | usePixelBufferObject () const |
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 Attributes | |
Collection< Pixels > | mDraws |
bool | mUsePixelBufferObject |
Wraps the OpenGL function glDrawPixels().
Bind it to an Actor in order to render one or more bitmaps on the screen. DrawPixels supports multiple bitmaps, can draw a subsection of a bitmap, and supports also PBOs (GL_EXT_pixel_buffer_object). See also DrawPixels::Pixels.
Definition at line 60 of file DrawPixels.hpp.
DrawPixels::DrawPixels | ( | ) |
Definition at line 112 of file DrawPixels.cpp.
References mDraws, mUsePixelBufferObject, and vl::Object::setAutomaticDelete().
void vl::DrawPixels::computeBounds_Implementation | ( | ) | [inline, virtual] |
Implements vl::Renderable.
Definition at line 134 of file DrawPixels.hpp.
void DrawPixels::render_Implementation | ( | const Actor * | actor, |
const Shader * | shader, | ||
const Camera * | camera, | ||
OpenGLContext * | gl_context | ||
) | const [virtual] |
Renders the bitamps.
If camera != NULL and actor != NULL and actor->transform() != NULL then the bitmaps position will follow the Actor's Transform. The renderer
parameter is ignored.
Implements vl::Renderable.
Definition at line 118 of file DrawPixels.cpp.
References vl::DrawPixels::Pixels::align(), vl::AlignHCenter, vl::AlignRight, vl::AlignTop, vl::AlignVCenter, vl::Collection< T >::at(), vl::Image::byteAlignment(), draws(), vl::Image::format(), vl::BufferObject::handle(), vl::Viewport::height(), vl::DrawPixels::Pixels::image(), vl::Image::isValid(), mDraws, vl::DrawPixels::Pixels::mPosition, vl::DrawPixels::Pixels::mSize, vl::DrawPixels::Pixels::mStart, vl::ImagePBO::pixelBufferObject(), vl::Image::pixels(), vl::Camera::project(), vl::Collection< T >::size(), vl::Actor::transform(), vl::Image::type(), vl::Camera::viewport(), VL_CHECK, VL_CHECK_OGL, vl::Image::width(), vl::Viewport::width(), vl::Transform::worldMatrix(), vl::Vector4< T_Scalar >::x(), vl::Vector2< T_Scalar >::x(), vl::Viewport::x(), vl::Vector4< T_Scalar >::y(), vl::Vector2< T_Scalar >::y(), and vl::Viewport::y().
const Collection<Pixels>* vl::DrawPixels::draws | ( | ) | const [inline] |
Definition at line 142 of file DrawPixels.hpp.
Referenced by render_Implementation().
Collection<Pixels>* vl::DrawPixels::draws | ( | ) | [inline] |
Definition at line 144 of file DrawPixels.hpp.
void DrawPixels::deletePixelBufferObjects | ( | ) |
deallocate PBOs
Definition at line 259 of file DrawPixels.cpp.
References mDraws, vl::Collection< T >::size(), and VL_CHECK_OGL.
void DrawPixels::releaseImages | ( | ) |
Iterates on the Pixels objects and sets their Image references to NULL.
Definition at line 269 of file DrawPixels.cpp.
References mDraws, NULL, and vl::Collection< T >::size().
bool DrawPixels::generatePixelBufferObjects | ( | EBufferObjectUsage | usage, |
bool | discard_local_storage | ||
) |
generates PBOs only for Pixels objects without a PBO handle
Definition at line 276 of file DrawPixels.cpp.
References mDraws, NULL, and vl::Collection< T >::size().
void DrawPixels::setUsePixelBufferObject | ( | bool | use_pbo ) |
Definition at line 299 of file DrawPixels.cpp.
References mUsePixelBufferObject.
bool vl::DrawPixels::usePixelBufferObject | ( | ) | const [inline] |
Definition at line 157 of file DrawPixels.hpp.
virtual void vl::DrawPixels::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.
Definition at line 161 of file DrawPixels.hpp.
virtual void vl::DrawPixels::deleteBufferObject | ( | ) | [inline, virtual] |
Destroys the BufferObject (vertex buffer objects) associated to this a Renderable.
Implements vl::Renderable.
Definition at line 163 of file DrawPixels.hpp.
Collection<Pixels> vl::DrawPixels::mDraws [protected] |
Definition at line 166 of file DrawPixels.hpp.
Referenced by deletePixelBufferObjects(), DrawPixels(), generatePixelBufferObjects(), releaseImages(), and render_Implementation().
bool vl::DrawPixels::mUsePixelBufferObject [protected] |
Definition at line 167 of file DrawPixels.hpp.
Referenced by DrawPixels(), and setUsePixelBufferObject().