natiny_render_triangle
void natiny_render_triangle(float x0, float y0, float x1, float y1, float x2, float y2);
Draws a filled triangle on the currently bound render target, using the current drawing color set by natiny_render_set_color().
Parameters
| Name | Type | Description |
|---|---|---|
x0 |
float |
First vertex X position |
y0 |
float |
First vertex Y position |
x1 |
float |
Second vertex X position |
y1 |
float |
Second vertex Y position |
x2 |
float |
Third vertex X position |
y2 |
float |
Third vertex Y position |
Example
natiny_render_triangle(160.0f, 40.0f, 100.0f, 160.0f, 220.0f, 160.0f);
Notes
- Vertices are submitted in the given order. Winding matters only when a bound custom material enables face culling.