RenderTools::Vertexbuffer Class Reference

#include <Vertexbuffer.h>

Inheritance diagram for RenderTools::Vertexbuffer:

RenderTools::RenderInterface RenderTools::AbstractPropertyContainer RenderTools::ContainerProperty RenderTools::AbstractProperty RenderTools::InitializeInterface

List of all members.

Public Member Functions

 Vertexbuffer (void)
 brief create a Vertexbuffer with xml specification
 ~Vertexbuffer (void)
virtual void createProperties (void)
virtual const string getTypeName (bool ofComponent=false) const
virtual void onInitialize (void)
virtual void onRender (void)
bool getDirectRendering (void) const
bool getUseProgram (void) const
GLenum getUsage (void) const
GLenum getMode (void) const
GLuint getNumVertices (void) const
void setUsage (GLenum usage)
void setMode (GLenum mode)
void setNumVertices (GLuint numVertices)
void setDirectRendering (bool state=true)
void setUseProgram (bool state=true)
void setVertexAttribute (GLuint vertexIndex, const string attribName, const GLfloat *data)
 sets an attribute by name
void setVertexAttribute (GLuint vertexIndex, GLuint attribIndex, const GLfloat *data)
 sets an attribute by index
void addAttribute (GLuint numFloats, const string name)
 adds (and not sets) a new attribute to the layout
GLuint getNumAttributes (void)
GLuint getVertexSize (void)
const vector< GLuint > & getAttributeSizes (void)
const vector< GLuint > & getAttributeOffsets (void)
const vector< string > & getAttributeNames (void)

Static Public Member Functions

static PropertyPtr create (const XMLNodePtr &xml=XMLNodePtr())


Detailed Description

Definition at line 11 of file Vertexbuffer.h.


Constructor & Destructor Documentation

RenderTools::Vertexbuffer::Vertexbuffer ( void   ) 

brief create a Vertexbuffer with xml specification

Definition at line 9 of file Vertexbuffer.cpp.

RenderTools::Vertexbuffer::~Vertexbuffer ( void   ) 

Definition at line 109 of file Vertexbuffer.cpp.


Member Function Documentation

void RenderTools::Vertexbuffer::addAttribute ( GLuint  numFloats,
const string  name 
)

adds (and not sets) a new attribute to the layout

increase the number of attributes

add the data-offset of this attribute

add 1 block of numFloats

push the name of the attribute

increase total size

if initialized reallocate

Definition at line 125 of file Vertexbuffer.cpp.

PropertyPtr RenderTools::Vertexbuffer::create ( const XMLNodePtr xml = XMLNodePtr()  )  [static]

Definition at line 23 of file Vertexbuffer.cpp.

void RenderTools::Vertexbuffer::createProperties ( void   )  [virtual]

based on the GL, add the names to the possible enumerants

Reimplemented from RenderTools::AbstractPropertyContainer.

Definition at line 31 of file Vertexbuffer.cpp.

const vector< string > & RenderTools::Vertexbuffer::getAttributeNames ( void   ) 

Definition at line 160 of file Vertexbuffer.cpp.

const vector< GLuint > & RenderTools::Vertexbuffer::getAttributeOffsets ( void   ) 

Definition at line 152 of file Vertexbuffer.cpp.

const vector< GLuint > & RenderTools::Vertexbuffer::getAttributeSizes ( void   ) 

Definition at line 156 of file Vertexbuffer.cpp.

bool RenderTools::Vertexbuffer::getDirectRendering ( void   )  const

Definition at line 196 of file Vertexbuffer.cpp.

GLenum RenderTools::Vertexbuffer::getMode ( void   )  const

Definition at line 168 of file Vertexbuffer.cpp.

GLuint RenderTools::Vertexbuffer::getNumAttributes ( void   ) 

Definition at line 144 of file Vertexbuffer.cpp.

GLuint RenderTools::Vertexbuffer::getNumVertices ( void   )  const

Definition at line 172 of file Vertexbuffer.cpp.

const string RenderTools::Vertexbuffer::getTypeName ( bool  ofComponent = false  )  const [virtual]

Reimplemented from RenderTools::ContainerProperty.

Definition at line 105 of file Vertexbuffer.cpp.

GLenum RenderTools::Vertexbuffer::getUsage ( void   )  const

Definition at line 164 of file Vertexbuffer.cpp.

bool RenderTools::Vertexbuffer::getUseProgram ( void   )  const

Definition at line 212 of file Vertexbuffer.cpp.

GLuint RenderTools::Vertexbuffer::getVertexSize ( void   ) 

Definition at line 148 of file Vertexbuffer.cpp.

void RenderTools::Vertexbuffer::onInitialize ( void   )  [virtual]

Reimplemented from RenderTools::AbstractPropertyContainer.

Definition at line 115 of file Vertexbuffer.cpp.

void RenderTools::Vertexbuffer::onRender ( void   )  [virtual]

TODO: GL_ELEMENT_ARRAY_BUFFER

bind the used arrays to the attributes in the program

Implements RenderTools::RenderInterface.

Definition at line 261 of file Vertexbuffer.cpp.

void RenderTools::Vertexbuffer::setDirectRendering ( bool  state = true  ) 

Definition at line 200 of file Vertexbuffer.cpp.

void RenderTools::Vertexbuffer::setMode ( GLenum  mode  ) 

Definition at line 180 of file Vertexbuffer.cpp.

void RenderTools::Vertexbuffer::setNumVertices ( GLuint  numVertices  ) 

Definition at line 184 of file Vertexbuffer.cpp.

void RenderTools::Vertexbuffer::setUsage ( GLenum  usage  ) 

Definition at line 176 of file Vertexbuffer.cpp.

void RenderTools::Vertexbuffer::setUseProgram ( bool  state = true  ) 

Definition at line 216 of file Vertexbuffer.cpp.

void RenderTools::Vertexbuffer::setVertexAttribute ( GLuint  vertexIndex,
GLuint  attribIndex,
const GLfloat *  data 
)

sets an attribute by index

copy the data to the appropriate location in the buffer

Definition at line 231 of file Vertexbuffer.cpp.

void RenderTools::Vertexbuffer::setVertexAttribute ( GLuint  vertexIndex,
const string  attribName,
const GLfloat *  data 
)

sets an attribute by name

Definition at line 221 of file Vertexbuffer.cpp.


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

Generated on Wed Jan 26 00:15:37 2011 for RenderTools by  doxygen 1.5.8