Skip to main content

Module shape

Module shape 

Source
Expand description

The shape module contains structs and functions for drawing simple 2D shapes to the screen.

Each shape instance will create a new VertexBuffer which need to individually be sent to the GPU. For that reason, this module should only be used for prototyping and applications where performance isn’t important.

Structs§

Rectangle
The Rectangle struct represents any 3 points in the 2d plane. Each point (vertex) is made up of:
Triangle
The Triangle struct represents any 3 points in the 2d plane. Each point (vertex) is made up of:

Functions§

shader_2d
This function simply compiles and returns a ShaderProgram which will be compatible with all shapes in this module.