# Visualization Library A lightweight C++ OpenGL middleware for 2D/3D graphics | [Home] [Tutorials] [All Classes] [Grouped Classes]

# vl::DrawPixels Class Reference

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

`#include <DrawPixels.hpp>`

Inheritance diagram for vl::DrawPixels:

List of all members.

## Classes
class | Pixels
| Represents a bitmap to be drawn on the screen. More...
## Public Member Functions
| DrawPixels ()
virtual const char * | className ()
| Returns the name of the class.
void | computeBounds_Implementation ()
void | render (const Actor *actor, const OpenGLContext *, const Camera *camera) 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 (EGLBufferUsage usage, bool discard_local_storage)
| generates PBOs only for Pixels objects without a PBO handle
void | setUsePixelBufferObject (bool use_pbo)
bool | usePixelBufferObject () const
## Protected Attributes
Collection< Pixels > | mDraws
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.

## Constructor & Destructor Documentation

DrawPixels::DrawPixels | ( |  | ) |

## Member Function Documentation

virtual const char* vl::DrawPixels::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Renderable.

void vl::DrawPixels::computeBounds_Implementation | ( |  | ) | `[inline, virtual]`

Implements vl::Renderable.

void DrawPixels::render | ( | const Actor * | actor,
|  | const OpenGLContext * | ,
|  | const Camera * | camera |
| ) |  |  | 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.

const Collection<Pixels>* vl::DrawPixels::draws | ( |  | ) | const`[inline]`

Collection<Pixels>* vl::DrawPixels::draws | ( |  | ) | `[inline]`

void DrawPixels::deletePixelBufferObjects | ( |  | ) |

deallocate PBOs

void DrawPixels::releaseImages | ( |  | ) |

Iterates on the Pixels objects and sets their Image references to NULL.

bool DrawPixels::generatePixelBufferObjects | ( | EGLBufferUsage | usage,
|  | bool | discard_local_storage |
| ) |  |  |

generates PBOs only for Pixels objects without a PBO handle

void DrawPixels::setUsePixelBufferObject | ( | bool | use_pbo | ) |

bool vl::DrawPixels::usePixelBufferObject | ( |  | ) | const`[inline]`

## Member Data Documentation

Collection<Pixels> vl::DrawPixels::mDraws`[protected]`

bool vl::DrawPixels::mUsePixelBufferObject`[protected]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/DrawPixels.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/DrawPixels.cpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 29 11:11:45 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.