Public Types | Public Member Functions | Public Attributes

Tiny2D::Shape::Geometry Struct Reference

Shape vertex (and optionally index) data. More...

#include <Tiny2D.h>

List of all members.

Public Types

enum  Type { Type_TriangleFan = 0, Type_Triangles, Type_Lines, Type_COUNT }
 

Geometry types.

More...

Public Member Functions

 Geometry ()
 Constucts empty geometry.
void SetIndices (int numIndices, const unsigned short *indices)
 Sets indices.
void SetNumVerts (int numVerts)
 Sets number of vertices.
void SetPosition (const void *data, int stride=sizeof(float)*2, VertexFormat format=VertexFormat_Float32, int count=2)
 Sets position data.
void SetTexCoord (const void *data, int usageIndex=0, int stride=sizeof(float)*2, VertexFormat format=VertexFormat_Float32, int count=2)
 Sets texture coordinate data for a specific stream (usage index)
void SetColor (const void *data, int usageIndex=0, int stride=sizeof(float)*4, VertexFormat format=VertexFormat_Float32, int count=2)
 Sets color data for a specific stream (usage index)
void AddStream (const VertexStream &stream)
 Adds vertex data stream.

Public Attributes

Type type
 Geometry primitive type; defaults to Type_TriangleFan.
int numVerts
 Number of vertices; defaults to 0.
int numStreams
 Number of vertex streams; defaults to 0.
VertexStream streams [16]
 Vertex streams.
int numIndices
 Number of indices; defaults to 0.
const unsigned short * indices
 Index data; defaults to NULL.

Detailed Description

Shape vertex (and optionally index) data.


Member Enumeration Documentation

Geometry types.

Enumerator:
Type_TriangleFan 

Triangle fan.

Type_Triangles 

Triangle list.

Type_Lines 

Line list.

Type_COUNT 

Constructor & Destructor Documentation

Tiny2D::Shape::Geometry::Geometry (  )

Constucts empty geometry.


Member Function Documentation

void Tiny2D::Shape::Geometry::AddStream ( const VertexStream stream )

Adds vertex data stream.

void Tiny2D::Shape::Geometry::SetColor ( const void *  data,
int  usageIndex = 0,
int  stride = sizeof(float) * 4,
VertexFormat  format = VertexFormat_Float32,
int  count = 2 
) [inline]

Sets color data for a specific stream (usage index)

void Tiny2D::Shape::Geometry::SetIndices ( int  numIndices,
const unsigned short *  indices 
) [inline]

Sets indices.

void Tiny2D::Shape::Geometry::SetNumVerts ( int  numVerts ) [inline]

Sets number of vertices.

void Tiny2D::Shape::Geometry::SetPosition ( const void *  data,
int  stride = sizeof(float) * 2,
VertexFormat  format = VertexFormat_Float32,
int  count = 2 
) [inline]

Sets position data.

void Tiny2D::Shape::Geometry::SetTexCoord ( const void *  data,
int  usageIndex = 0,
int  stride = sizeof(float) * 2,
VertexFormat  format = VertexFormat_Float32,
int  count = 2 
) [inline]

Sets texture coordinate data for a specific stream (usage index)


Member Data Documentation

const unsigned short* Tiny2D::Shape::Geometry::indices

Index data; defaults to NULL.

Number of indices; defaults to 0.

Number of vertex streams; defaults to 0.

Number of vertices; defaults to 0.

Vertex streams.

Geometry primitive type; defaults to Type_TriangleFan.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines