This is a helper for drawing simple geometric shapes:
Initialization
The GeometryPrimitive class must be created from a factory method which takes the Direct3D 11 device context.
For exception safety, it is recommended you make use of the C++ RAII pattern and use a std::unique_ptr or std::shared_ptr
Simple drawing
The draw method accepts an optional texture parameter, wireframe flag, and a callback function which can be used to override the default rendering state:
- Cube
- Sphere
- GeoSphere
- Cylinder
- Torus
- Teapot
Initialization
The GeometryPrimitive class must be created from a factory method which takes the Direct3D 11 device context.
std::unique_ptr<GeometricPrimitive> shape(GeometricPrimitive::CreateTeapot(deviceContext));
Simple drawing
shape->Draw(world, view, projection, Colors::CornflowerBlue);
shape->Draw(world, view, projection, Colors::White, catTexture, false, [=]
{
deviceContext->OMSetBlendState(...);
});