GLVertexBufferObject Class Reference

#include <GLVertexBufferObject.h>

List of all members.

Public Member Functions

 GLVertexBufferObject (bool indexbuffer=false)
 > create buffer. Tell the handler if you wish to store indices or other data.
 ~GLVertexBufferObject ()
void init_data (unsigned size, const void *data, int usage)
void init_sub_data (unsigned offset, unsigned subsize, const void *data)
 > init/set sub data
void bind () const
 > bind buffer
void unbind () const
 > unbind buffer
void * map (int access)
unsigned int get_map_size () const
 > get size of mapped space
void unmap ()
 > unmap buffer

Protected Attributes

GLuint id_
unsigned int size_
bool mapped_
int target_


Detailed Description

Definition at line 26 of file GLVertexBufferObject.h.


Constructor & Destructor Documentation

GLVertexBufferObject::GLVertexBufferObject ( bool  indexbuffer = false  ) 

> create buffer. Tell the handler if you wish to store indices or other data.

Definition at line 26 of file GLVertexBufferObject.cpp.

References DIALOG_ASSERT, glGenBuffersARB, GLStateExtension::hasVBO(), and id_.

GLVertexBufferObject::~GLVertexBufferObject (  ) 

Definition at line 35 of file GLVertexBufferObject.cpp.

References glDeleteBuffersARB, id_, mapped_, and unmap().


Member Function Documentation

void GLVertexBufferObject::init_data ( unsigned  size,
const void *  data,
int  usage 
)

> call ONCE after creation, to set data size and optionally data. > pointer to data can be NULL to just (re)size the buffer. > usage can be one of GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, > GL_STREAM_COPY_ARB, GL_STATIC_DRAW_ARB, GL_STATIC_READ_ARB, > GL_STATIC_COPY_ARB, GL_DYNAMIC_DRAW_ARB, GL_DYNAMIC_READ_ARB, > GL_DYNAMIC_COPY_ARB

Definition at line 41 of file GLVertexBufferObject.cpp.

References bind(), glBufferDataARB, size_, target_, and unbind().

Referenced by GraphicalLandscapeMap::create(), Water2Patches::generate(), MipMapPatchIndexs::generate(), and GraphicalLandscapeMap::updateWholeBuffer().

void GLVertexBufferObject::init_sub_data ( unsigned  offset,
unsigned  subsize,
const void *  data 
)

> init/set sub data

Definition at line 49 of file GLVertexBufferObject.cpp.

References bind(), glBufferSubDataARB, target_, and unbind().

Referenced by Water2Patches::generate(), and MipMapPatchIndexs::generate().

void GLVertexBufferObject::bind (  )  const

> bind buffer

Definition at line 56 of file GLVertexBufferObject.cpp.

References glBindBufferARB, id_, and target_.

Referenced by VisibilityPatchGrid::drawLand(), VisibilityPatchGrid::drawWater(), init_data(), init_sub_data(), map(), and unmap().

void GLVertexBufferObject::unbind (  )  const

> unbind buffer

Definition at line 61 of file GLVertexBufferObject.cpp.

References glBindBufferARB, and target_.

Referenced by VisibilityPatchGrid::drawLand(), VisibilityPatchGrid::drawWater(), init_data(), and init_sub_data().

void * GLVertexBufferObject::map ( int  access  ) 

> map buffer to address, access is one of GL_READ_ONLY_ARB, GL_WRITE_ONLY_ARB, > GL_ERAD_WRITE_ARB.

Definition at line 66 of file GLVertexBufferObject.cpp.

References bind(), DIALOG_ASSERT, glMapBufferARB, mapped_, and target_.

unsigned int GLVertexBufferObject::get_map_size (  )  const [inline]

> get size of mapped space

Definition at line 50 of file GLVertexBufferObject.h.

References size_.

Referenced by GraphicalLandscapeMap::create(), Water2Patches::generate(), and MipMapPatchIndexs::generate().

void GLVertexBufferObject::unmap (  ) 

> unmap buffer

Definition at line 77 of file GLVertexBufferObject.cpp.

References bind(), DIALOG_ASSERT, GL_TRUE, glUnmapBufferARB, Logger::log(), mapped_, and target_.

Referenced by ~GLVertexBufferObject().


Member Data Documentation

GLuint GLVertexBufferObject::id_ [protected]

Definition at line 55 of file GLVertexBufferObject.h.

Referenced by bind(), GLVertexBufferObject(), and ~GLVertexBufferObject().

unsigned int GLVertexBufferObject::size_ [protected]

Definition at line 56 of file GLVertexBufferObject.h.

Referenced by get_map_size(), and init_data().

bool GLVertexBufferObject::mapped_ [protected]

Definition at line 57 of file GLVertexBufferObject.h.

Referenced by map(), unmap(), and ~GLVertexBufferObject().

int GLVertexBufferObject::target_ [protected]

Definition at line 58 of file GLVertexBufferObject.h.

Referenced by bind(), init_data(), init_sub_data(), map(), unbind(), and unmap().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:02 2009 for Scorched3D by  doxygen 1.5.3