omegalib  13.1
omega::VertexArray Class Reference

A collection of vertex buffers forming a complete vertex stream. More...

#include <GpuBuffer.h>

Public Member Functions

virtual void dispose ()
 
void bind (GpuProgram *program)
 
void unbind ()
 
void setBuffer (uint index, VertexBuffer *buffer)
 
VertexBuffergetBuffer (uint index)
 
void clearBuffers ()
 
void setAttributeBinding (uint buffer, uint attribute, const String &name)
 
bool hasIndices ()
 Returns true if this array has indices attached. More...
 
VertexBufferaddBuffer (uint index, VertexBuffer::BufferType type, size_t size, void *data)
 Convenience menthod for creating a vertex buffer and attaching it to this array. More...
 
void addAttribute (uint buffer, uint index, const String &name, VertexBuffer::AttributeType type, bool normalize, uint components, uint offset, uint stride)
 Convenience method for creating and binding a named attribute for a buffer. More...
 
- Public Member Functions inherited from omega::GpuResource
 GpuResource (GpuContext *ctx)
 
GpuContextgetContext ()
 
- Public Member Functions inherited from omicron::ReferenceType
 ReferenceType ()
 
virtual ~ReferenceType ()
 
void ref ()
 
void unref ()
 
long refCount ()
 

Static Public Attributes

static const int MaxBuffers = 8
 

Protected Member Functions

 VertexArray (GpuContext *context)
 

Friends

class GpuContext
 

Additional Inherited Members

- Static Public Member Functions inherited from omicron::ReferenceType
static void printObjCounts ()
 
- Static Protected Attributes inherited from omicron::ReferenceType
static List< ReferenceType * > mysObjList
 

Detailed Description

A collection of vertex buffers forming a complete vertex stream.

+ Inheritance diagram for omega::VertexArray:

Constructor & Destructor Documentation

omega::VertexArray::VertexArray ( GpuContext context)
protected

Member Function Documentation

void omega::VertexArray::addAttribute ( uint  buffer,
uint  index,
const String name,
VertexBuffer::AttributeType  type,
bool  normalize,
uint  components,
uint  offset,
uint  stride 
)

Convenience method for creating and binding a named attribute for a buffer.

VertexBuffer* omega::VertexArray::addBuffer ( uint  index,
VertexBuffer::BufferType  type,
size_t  size,
void *  data 
)

Convenience menthod for creating a vertex buffer and attaching it to this array.

void omega::VertexArray::bind ( GpuProgram program)
void omega::VertexArray::clearBuffers ( )
virtual void omega::VertexArray::dispose ( )
virtual

Implements omega::GpuResource.

VertexBuffer* omega::VertexArray::getBuffer ( uint  index)
inline
bool omega::VertexArray::hasIndices ( )
inline

Returns true if this array has indices attached.

Only valid after a call to bind()

void omega::VertexArray::setAttributeBinding ( uint  buffer,
uint  attribute,
const String name 
)
void omega::VertexArray::setBuffer ( uint  index,
VertexBuffer buffer 
)
void omega::VertexArray::unbind ( )

Friends And Related Function Documentation

friend class GpuContext
friend

Member Data Documentation

const int omega::VertexArray::MaxBuffers = 8
static

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