| 4 | namespace NULLCCanvas |
| 5 | { |
| 6 | void CanvasClearRGB(float red, float green, float blue, Canvas* ptr) |
| 7 | { |
| 8 | if(!ptr) |
| 9 | { |
| 10 | nullcThrowError("ERROR: Canvas object is nullptr"); |
| 11 | return; |
| 12 | } |
| 13 | float fRed = red / 255.0f; |
| 14 | float fGreen = green / 255.0f; |
| 15 | float fBlue = blue / 255.0f; |
| 16 | for(int i = 0; i < ptr->width * ptr->height; i++) |
| 17 | { |
| 18 | ((float*)ptr->data.ptr)[i * 4 + 0] = fRed; |
| 19 | ((float*)ptr->data.ptr)[i * 4 + 1] = fGreen; |
| 20 | ((float*)ptr->data.ptr)[i * 4 + 2] = fBlue; |
| 21 | ((float*)ptr->data.ptr)[i * 4 + 3] = 1.0f; |
| 22 | } |
| 23 | } |
| 24 | void CanvasClearRGBA(float red, float green, float blue, float alpha, Canvas* ptr) |
| 25 | { |
| 26 | if(!ptr) |
nothing calls this directly
no test coverage detected