The Nebula Device 3: CoreGraphics::RenderShape Class Reference

The Nebula Device 3

CoreGraphics::RenderShape Class Reference

#include <rendershape.h>


Detailed Description

Describes a shape which is rendered through the ShapeRenderer singleton. Shape rendering may be relatively inefficient and should only be used for debug visualizations. Please note that vertex and index data will be copied into a memory stream, so that it is safe to release or alter the original data once the shape object has been created. You have to be aware of the performance and memory-footprint implications though. Shape objects can be copied, but they will share the internal vertex/index data copy.

(C) 2008 Radon Labs GmbH

Public Types

enum  Type
 shape types

Public Member Functions

 RenderShape ()
 default constructor
 RenderShape (Threading::ThreadId threadId, Type shapeType, const Math::matrix44 &modelTransform, const Math::float4 &color)
 shortcut constructor for simple shapes
bool IsValid () const
 return true if object has been setup
void SetupSimpleShape (Threading::ThreadId threadId, Type shapeType, const Math::matrix44 &modelTransform, const Math::float4 &color)
 setup simple shape
void SetupPrimitives (Threading::ThreadId threadId, const Math::matrix44 &modelTransform, PrimitiveTopology::Code topology, SizeT numPrimitives, const void *vertices, SizeT vertexWidth, const Math::float4 &color)
 setup primitive batch (SLOW!)
void SetupIndexedPrimitives (Threading::ThreadId threadId, const Math::matrix44 &modelTransform, PrimitiveTopology::Code topology, SizeT numPrimitives, const void *vertices, SizeT numVertices, SizeT vertexWidth, const void *indices, IndexType::Code indexType, const Math::float4 &color)
 setup indexed primitive batch (SLOW!)
Threading::ThreadId GetThreadId () const
 get the thread id of this shape
Type GetShapeType () const
 get shape type
const Math::matrix44GetModelTransform () const
 get model transform
PrimitiveTopology::Code GetTopology () const
 get primitive topology
SizeT GetNumPrimitives () const
 get number of primitives
const void * GetVertexData () const
 get pointer to vertex data (returns 0 if none exist)
SizeT GetVertexWidth () const
 get vertex width in number of floats
SizeT GetNumVertices () const
 get number of vertices (only for indexed primitives)
const void * GetIndexData () const
 get index data (returns 0 if none exists)
IndexType::Code GetIndexType () const
 get the index type (16 or 32 bit)
const Math::float4GetColor () const
 get shape color