Classes | Public Types | Static Public Member Functions

Tiny2D::Shape Class Reference

Renderable shape utilities. More...

#include <Tiny2D.h>

List of all members.

Classes

struct  DrawParams
 Shape drawing parameters. More...
struct  Geometry
 Shape vertex (and optionally index) data. More...
struct  VertexStream
 Vertex stream decription. More...

Public Types

enum  Blending {
  Blending_Default = 0, Blending_None, Blending_Additive, Blending_Alpha,
  Blending_COUNT
}
 

Blending modes.

More...
enum  VertexFormat { VertexFormat_Float32 = 0, VertexFormat_UInt8, VertexFormat_COUNT }
 

Vertex format.

More...
enum  VertexUsage { VertexUsage_Position = 0, VertexUsage_TexCoord, VertexUsage_Color, VertexUsage_COUNT }
 

Vertex usage.

More...

Static Public Member Functions

static void Draw (const DrawParams *params)
 Draws untextured shape.
static void DrawRectangle (const Rect &rect, float rotation=0.0f, const Color &color=Color::White)
 Draws rectangle.
static void DrawCircle (const Vec2 &center, float radius, int numSegments=12, float rotation=0.0f, const Color &color=Color::White)
 Draws circle.
static void DrawLine (const Vec2 &start, const Vec2 &end, const Color &color=Color::White)
 Draws the line.
static void DrawLines (const Vec2 *points, int numLines, const Color &color=Color::White)
 Draws the lines; expects 'numLines' * 2 elements in 'points' array.

Detailed Description

Renderable shape utilities.


Member Enumeration Documentation

Blending modes.

Enumerator:
Blending_Default 

Defaults to (SrcAlpha, 1-ScrAlpha) for transparent textures; otherwise disabled.

Blending_None 

Blending disabled.

Blending_Additive 

Additive blending (One, One)

Blending_Alpha 

Standard alpha-blending mode using alpha channel to perform blending (SrcAlpha, 1-ScrAlpha)

Blending_COUNT 

Vertex format.

Enumerator:
VertexFormat_Float32 

32-bit float

VertexFormat_UInt8 

Unsigned 8-bit integer.

VertexFormat_COUNT 

Vertex usage.

Enumerator:
VertexUsage_Position 

Position.

VertexUsage_TexCoord 

Texture coordinate.

VertexUsage_Color 

Color.

VertexUsage_COUNT 

Member Function Documentation

static void Tiny2D::Shape::Draw ( const DrawParams params ) [static]

Draws untextured shape.

static void Tiny2D::Shape::DrawCircle ( const Vec2 center,
float  radius,
int  numSegments = 12,
float  rotation = 0.0f,
const Color color = Color::White 
) [static]

Draws circle.

static void Tiny2D::Shape::DrawLine ( const Vec2 start,
const Vec2 end,
const Color color = Color::White 
) [static]

Draws the line.

static void Tiny2D::Shape::DrawLines ( const Vec2 points,
int  numLines,
const Color color = Color::White 
) [static]

Draws the lines; expects 'numLines' * 2 elements in 'points' array.

static void Tiny2D::Shape::DrawRectangle ( const Rect rect,
float  rotation = 0.0f,
const Color color = Color::White 
) [static]

Draws rectangle.


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