Simple Shapes

There are 3 pre-defined Simple Shapes in Mach::GL. Rectangle, Circle and Triangle. These can be created using the following constructors:

Plane::SimpleRect rect(simpleProperties, windowDimension);
Plane::SimpleCircle rect(simpleProperties, windowDimension);
Plane::SimpleTriangle rect(simpleProperties, windowDimension);

Plane::SimpleProperties example


Plane::SimpleProperties properties;

properties.position = float2(20, 20); // Pixel space
properties.size = float2(300, 300);
properties.color = float4(1, 0, 1, 1);
properties.image = nullptr; //Can take in a Graphics::MACH_IMAGE and will override the color

All Simple Shapes are created equally. In their contructors, they all take in a Plane::SimpleProperties parameter. The SimepleProperties object defines the characteristics of the shape. As with all Mach::GL objects, any that take in a "properties" object will need to have the function create() called to initilize the object.

All SimpleShapes have a translate(trMatrix) function which takes in a matrix4x4 object. This allows for for runtime translations of the shape.

All Simple Shapes can be rendered calling the render() function on the object.