Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Classes | Public Member Functions | Protected Attributes

vl::DrawPixels Class Reference

Wraps the OpenGL function glDrawPixels(). More...

#include <DrawPixels.hpp>

Inheritance diagram for vl::DrawPixels:
vl::Renderable vl::Object

List of all members.

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< PixelsmDraws
bool mUsePixelBufferObject

Detailed Description

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.

Note:
If the given Actor has an associated transform the bitmap position will follow it.
Remarks:
Be aware that depth test, stencil test, alpha test, clipping planes etc. can affect the rendering of the bitmap. Since this function uses the glRasterPos OpenGL function lighting, texturing and the current color might affect the rendering. For more information look at the glRasterPos documentation.

Definition at line 60 of file DrawPixels.hpp.


Constructor & Destructor Documentation

DrawPixels::DrawPixels (  )

Definition at line 112 of file DrawPixels.cpp.

References mDraws, mUsePixelBufferObject, and vl::Object::setAutomaticDelete().


Member Function Documentation

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]
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.

Note:
This function does not touch the local (non GPU) data stored in the buffers associated to the vertex attributes and DrawCall.

Implements vl::Renderable.

Definition at line 163 of file DrawPixels.hpp.


Member Data Documentation

Definition at line 167 of file DrawPixels.hpp.

Referenced by DrawPixels(), and setUsePixelBufferObject().


The documentation for this class was generated from the following files:

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:09.
Permission is granted to use this page to write and publish articles regarding Visualization Library.