natiny_render_set_color
void natiny_render_set_color(float r, float g, float b, float a);
Sets the draw color used to tint all subsequent non-clear draws until it is changed or another window is bound.
Parameters
| Name | Type | Description |
|---|---|---|
r |
float |
Red channel (0.0 – 1.0) |
g |
float |
Green channel (0.0 – 1.0) |
b |
float |
Blue channel (0.0 – 1.0) |
a |
float |
Alpha channel (0.0 – 1.0) |
Example
natiny_render_set_color(1.0f, 0.0f, 0.0f, 1.0f);
Notes
- The color resets to opaque white
(1, 1, 1, 1)onnatiny_window_bind. - It affects all subsequent non-clear draws, including shapes, textures,
surfaces, text and models. It does not affect
natiny_render_clear. - A model has a tint of its own, set with natiny_model_set_color; the two multiply, so a bulk draw can still differ per model.
- Changing the color does not cause a batch break - different colors can coexist in the same draw batch for maximum performance.