# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Attributes

# vl::GLBufferObject Class Reference

The GLBufferObject class is a Buffer that can upload its data on the GPU memory. More...

`#include <GLBufferObject.hpp>`

Inheritance diagram for vl::GLBufferObject:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| GLBufferObject ()
| GLBufferObject (const GLBufferObject &other)
GLBufferObject & | operator= (const GLBufferObject &other)
void | swap (GLBufferObject &other)
| ~GLBufferObject ()
void | setHandle (unsigned int handle)
unsigned int | handle () const
GLsizeiptr | byteCountGPU () const
void | createGLBufferObject ()
void | deleteGLBufferObject ()
void | downloadGLBufferObject ()
void | setBufferData (EGLBufferUsage usage, bool discard_local_storage=false)
void | setBufferSubData (GLintptr offset=0, GLsizeiptr byte_count=-1, bool discard_local_storage=false)
void | setBufferData (GLsizeiptr byte_count, const GLvoid *data, EGLBufferUsage usage)
void | setBufferSubData (GLintptr offset, GLsizeiptr byte_count, const GLvoid *data)
void * | mapGPUBuffer (EGLBufferAccess access)
bool | unmapGPUBuffer ()
EGLBufferUsage | usage () const

## Protected Attributes

unsigned int | mHandle
GLsizeiptr | mByteCountGPU
EGLBufferUsage | mUsage

## Detailed Description

The GLBufferObject class is a Buffer that can upload its data on the GPU memory.

Remarks:
  GLBufferObject is the storage used by ArrayAbstract and subclasses like ArrayFloat3, ArrayUByte4 etc.

Definition at line 55 of file GLBufferObject.hpp.

## Constructor & Destructor Documentation

vl::GLBufferObject::GLBufferObject | ( | ) | `[inline]`

Definition at line 59 of file GLBufferObject.hpp.

References vl::BU_STATIC_DRAW, mByteCountGPU, mHandle, mUsage, and VL_DEBUG_SET_OBJECT_NAME.

vl::GLBufferObject::GLBufferObject | ( | const GLBufferObject & | other ) | `[inline]`

Definition at line 67 of file GLBufferObject.hpp.

References vl::BU_STATIC_DRAW, mByteCountGPU, mHandle, mUsage, and VL_DEBUG_SET_OBJECT_NAME.

vl::GLBufferObject::~GLBufferObject | ( | ) | `[inline]`

Definition at line 104 of file GLBufferObject.hpp.

References deleteGLBufferObject().

## Member Function Documentation

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

Returns the name of the class.

Reimplemented from vl::Buffer.

Definition at line 58 of file GLBufferObject.hpp.

GLBufferObject& vl::GLBufferObject::operator= | ( | const GLBufferObject & | other ) | `[inline]`

Definition at line 78 of file GLBufferObject.hpp.

References deleteGLBufferObject().

void vl::GLBufferObject::swap | ( | GLBufferObject & | other ) | `[inline]`

Definition at line 86 of file GLBufferObject.hpp.

References mByteCountGPU, mHandle, and mUsage.

void vl::GLBufferObject::setHandle | ( | unsigned int | handle ) | `[inline]`

Definition at line 109 of file GLBufferObject.hpp.

References handle(), and mHandle.

unsigned int vl::GLBufferObject::handle | ( | ) | const`[inline]`

Definition at line 111 of file GLBufferObject.hpp.

References mHandle.

Referenced by vl::OpenGLContext::bindVAS(), createGLBufferObject(), vl::Texture::createTexture(), deleteGLBufferObject(), downloadGLBufferObject(), mapGPUBuffer(), vl::readPixels(), vl::DrawPixels::render_Implementation(), setBufferData(), setBufferSubData(), setHandle(), and unmapGPUBuffer().

GLsizeiptr vl::GLBufferObject::byteCountGPU | ( | ) | const`[inline]`

Definition at line 113 of file GLBufferObject.hpp.

References mByteCountGPU.

Referenced by downloadGLBufferObject(), setBufferSubData(), and vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::sizeGPU().

void vl::GLBufferObject::createGLBufferObject | ( | ) | `[inline]`

Definition at line 115 of file GLBufferObject.hpp.

References handle(), mByteCountGPU, mHandle, VL_CHECK, and vl::VL_glGenBuffers().

Referenced by mapGPUBuffer(), setBufferData(), setBufferSubData(), and unmapGPUBuffer().

void vl::GLBufferObject::deleteGLBufferObject | ( | ) | `[inline]`

Definition at line 129 of file GLBufferObject.hpp.

References handle(), mByteCountGPU, mHandle, and vl::VL_glDeleteBuffers().

Referenced by vl::Array< T_VectorType, T_Scalar, T_GL_Size, T_GL_Type >::clear(), vl::Geometry::deleteVBOs(), operator=(), and ~GLBufferObject().

void vl::GLBufferObject::downloadGLBufferObject | ( | ) | `[inline]`

Definition at line 139 of file GLBufferObject.hpp.

References byteCountGPU(), vl::GBA_READ_ONLY, handle(), mapGPUBuffer(), vl::Buffer::ptr(), vl::Buffer::resize(), and unmapGPUBuffer().

void vl::GLBufferObject::setBufferData | ( | EGLBufferUsage | usage,
|  | bool | discard_local_storage = `false`
| ) |  | `[inline]`

Definition at line 152 of file GLBufferObject.hpp.

References vl::Buffer::bytesUsed(), vl::Buffer::clear(), mUsage, vl::Buffer::ptr(), and usage().

Referenced by vl::readPixels(), and vl::ArrayAbstract::updateVBO().

void vl::GLBufferObject::setBufferSubData | ( | GLintptr | offset = `0`,
|  | GLsizeiptr | byte_count = `-1`,
|  | bool | discard_local_storage = `false`
| ) |  | `[inline]`

Definition at line 162 of file GLBufferObject.hpp.

References byteCountGPU(), vl::Buffer::clear(), and vl::Buffer::ptr().

void vl::GLBufferObject::setBufferData | ( | GLsizeiptr | byte_count,
|  | const GLvoid * | data,
|  | EGLBufferUsage | usage
| ) |  | `[inline]`

Definition at line 172 of file GLBufferObject.hpp.

References createGLBufferObject(), handle(), mByteCountGPU, mUsage, usage(), VL_CHECK, VL_CHECK_OGL, vl::VL_glBindBuffer(), and vl::VL_glBufferData().

void vl::GLBufferObject::setBufferSubData | ( | GLintptr | offset,
|  | GLsizeiptr | byte_count,
|  | const GLvoid * | data
| ) |  | `[inline]`

Definition at line 190 of file GLBufferObject.hpp.

References createGLBufferObject(), handle(), VL_CHECK, vl::VL_glBindBuffer(), and vl::VL_glBufferSubData().

void* vl::GLBufferObject::mapGPUBuffer | ( | EGLBufferAccess | access ) | `[inline]`

Definition at line 204 of file GLBufferObject.hpp.

References createGLBufferObject(), handle(), vl::Buffer::ptr(), VL_CHECK, VL_CHECK_OGL, vl::VL_glBindBuffer(), and vl::VL_glMapBuffer().

Referenced by downloadGLBufferObject().

bool vl::GLBufferObject::unmapGPUBuffer | ( | ) | `[inline]`

Definition at line 225 of file GLBufferObject.hpp.

References createGLBufferObject(), handle(), VL_CHECK, VL_CHECK_OGL, vl::VL_glBindBuffer(), and vl::VL_glUnmapBuffer().

Referenced by downloadGLBufferObject().

EGLBufferUsage vl::GLBufferObject::usage | ( | ) | const`[inline]`

Definition at line 240 of file GLBufferObject.hpp.

References mUsage.

Referenced by vl::readPixels(), and setBufferData().

## Member Data Documentation

unsigned int vl::GLBufferObject::mHandle`[protected]`

Definition at line 243 of file GLBufferObject.hpp.

Referenced by createGLBufferObject(), deleteGLBufferObject(), GLBufferObject(), handle(), setHandle(), and swap().

GLsizeiptr vl::GLBufferObject::mByteCountGPU`[protected]`

Definition at line 244 of file GLBufferObject.hpp.

Referenced by byteCountGPU(), createGLBufferObject(), deleteGLBufferObject(), GLBufferObject(), setBufferData(), and swap().

EGLBufferUsage vl::GLBufferObject::mUsage`[protected]`

Definition at line 245 of file GLBufferObject.hpp.

Referenced by GLBufferObject(), setBufferData(), swap(), and usage().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/GLBufferObject.hpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:41.
Permission is granted to use this page to write and publish articles regarding Visualization Library.