- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

ufo::UVertexArray Class Reference

#include <uvertexarray.hpp>

Inheritance diagram for ufo::UVertexArray:

ufo::UObject ufo::UCollectable List of all members.

Public Types

enum  Type {
  NoType = 0, V3F, C3F_V3F, CARGB_V3F,
  CRGBA_V2F
}

Public Member Functions

void setOffset (float x, float y)
void add (float x, float y)
void setColor (const UColor &col)
int getCount () const
int getType () const
void setType (Type t)
void * getArray ()
std::vector< std::pair< float,
float > > 
getVertices () const
std::vector< UColorgetColors () const

Protected Member Functions

void dispose ()

Detailed Description

An abstraction for vertex arrays with otional colors. Warning: This API may change and is not yet stable
Author:
Johannes Schmidt


Member Enumeration Documentation

enum ufo::UVertexArray::Type
 

This type is used to determine the array returned by getArray.

See also:
getArray
Enumeration values:
V3F  3 floats for vertices.
C3F_V3F  3 floats for color and 3 floats for vertices.
CARGB_V3F  argb color and 3 floats for vertices
CRGBA_V2F  argb color and 3 floats for vertices


Member Function Documentation

void ufo::UVertexArray::add float  x,
float  y
 

Adds a new vertex to the array.

void ufo::UVertexArray::dispose  )  [protected]
 

Deletes allocated memory for the returned vertex array.

void* ufo::UVertexArray::getArray  ) 
 

Returns:
A void pointer array of the vertices in the given type. The returned array is automatically freed by UVertexArray on destruction or if a new type was set.

std::vector<UColor> ufo::UVertexArray::getColors  )  const
 

Returns:
A vector with colors for each vertex.

int ufo::UVertexArray::getCount  )  const
 

Returns:
The total count of vertices.

int ufo::UVertexArray::getType  )  const
 

Returns:
The type of vertices.
See also:
getArray

std::vector<std::pair<float, float> > ufo::UVertexArray::getVertices  )  const
 

Returns:
A vector with plain coordinates of the vertices.

void ufo::UVertexArray::setColor const UColor col  ) 
 

Sets a new color for all following vertices.

void ufo::UVertexArray::setOffset float  x,
float  y
 

Sets an offset for all following points (not yet implemented).

void ufo::UVertexArray::setType Type  t  ) 
 

Explicitely sets the type of the vertices. This effects the output of getArray.

See also:
getArray


The documentation for this class was generated from the following file:
The libUFO Project - written by Johannes Schmidt