Main > Features > Shapes

Tiny2D provides convenience API for drawing simple shapes
such as rectangles, lines, circles or fullscreen quads.

If you need to draw custom shape, you can specify your own
vertex positions, texture coordinates or colors.

Below example demonstrates drawing textured triangle:

const float my_positions[] =
{
	10.0f, 10.0f,
	100.0f, 10.0f,
	10.0f, 200.0f
};

const float my_texCoords[] =
{
	0.0f, 0.0f,
	1.0f, 0.0f,
	0.0f, 1.0f
};

Shape::DrawParams params;
params.SetNumVerts(3);
params.SetPosition(my_positions);
params.SetTexCoord(my_texCoords);

texture.Draw(&params);






Contact: contact at pixelelephant dot com
(C) 2013 Pixel Elephant - All Rights Reserved