Introduce QuickFill

This commit is contained in:
Jaby
2022-09-08 21:36:12 +02:00
parent 00cdabb5de
commit b523c2c73f
3 changed files with 33 additions and 22 deletions

View File

@@ -3,25 +3,17 @@
#include "../jabyengine_defines.h"
namespace GPU {
struct __no_align Color3 {
uint8_t blue;
uint8_t green;
uint8_t red;
struct Color {
uint8_t red = 0;
uint8_t green = 0;
uint8_t blue = 0;
static constexpr Color3 black() {
return {0x0, 0x0, 0x0};
constexpr Color() = default;
constexpr Color(uint8_t r, uint8_t g, uint8_t b) : blue(b), green(g), red(r) {
}
static constexpr Color3 rgb(uint8_t r, uint8_t g, uint8_t b) {
return {b, g, r};
}
};
struct __no_align Color {
uint8_t reserved;
Color3 color_data;
constexpr Color(Color3 color) : reserved(0), color_data(color) {
constexpr uint32_t raw() const {
return ((this->blue << 16) | (this->green << 8) | this->red);
}
};
}