diff options
| author | realtradam <[email protected]> | 2023-01-06 15:53:53 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-01-06 15:53:53 -0500 |
| commit | 729a6b3b9cb0315106c87079a0eba9b294f02159 (patch) | |
| tree | 4d7062c70b13349685bd7dc39295af6b1dc64a25 /src/rodeo_math.c | |
| parent | b1f855a82b40f1caeaf4d672638f2cfc933c8040 (diff) | |
| download | RodeoKit-729a6b3b9cb0315106c87079a0eba9b294f02159.tar.gz RodeoKit-729a6b3b9cb0315106c87079a0eba9b294f02159.zip | |
render batching for coloured rectangles
Diffstat (limited to 'src/rodeo_math.c')
| -rw-r--r-- | src/rodeo_math.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rodeo_math.c b/src/rodeo_math.c new file mode 100644 index 0000000..99f61af --- /dev/null +++ b/src/rodeo_math.c @@ -0,0 +1,14 @@ +#include "rodeo.h" +#include "rodeo_math.h" + +uint32_t +Rodeo__\ +Math__\ +color_rgba_to_uint32(const struct Rodeo__color_rgba_t color) +{ + return + ((uint32_t)(uint8_t)(color.red * 255)) + | ((uint32_t)(uint8_t)(color.green * 255)) << (8 * 1) + | ((uint32_t)(uint8_t)(color.blue * 255)) << (8 * 2) + | ((uint32_t)(uint8_t)(color.alpha * 255)) << (8 * 3); +} |
