2026-07-05 20:55:17 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
namespace UwU {
|
|
|
|
|
|
|
|
|
|
// Color datatype returns individual channel values from rgba hexcode
|
|
|
|
|
struct Color {
|
|
|
|
|
Color(uint32_t hex) {
|
|
|
|
|
this->a = hex & 0x000000ff;
|
|
|
|
|
this->b = (hex & 0x0000ff00) >> 8;
|
|
|
|
|
this->g = (hex & 0x00ff0000) >> 16;
|
|
|
|
|
this->r = (hex & 0xff000000) >> 24;
|
|
|
|
|
}
|
2026-07-06 17:33:52 -07:00
|
|
|
Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
|
|
|
|
|
this->r = r;
|
|
|
|
|
this->g = g;
|
|
|
|
|
this->b = b;
|
|
|
|
|
this->a = a;
|
|
|
|
|
}
|
2026-07-05 20:55:17 -07:00
|
|
|
Color() {}
|
|
|
|
|
uint8_t r;
|
|
|
|
|
uint8_t g;
|
|
|
|
|
uint8_t b;
|
|
|
|
|
uint8_t a;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Coord2 datatype for xy coordinates, from top-left of surface
|
2026-07-08 16:50:17 -07:00
|
|
|
// struct Coord2 {
|
|
|
|
|
// Coord2(uint16_t x, uint16_t y) {
|
|
|
|
|
// this->x = x;
|
|
|
|
|
// this->y = y;
|
|
|
|
|
// }
|
|
|
|
|
// Coord2() {}
|
|
|
|
|
// uint16_t x;
|
|
|
|
|
// uint16_t y;
|
|
|
|
|
// };
|
2026-07-05 20:55:17 -07:00
|
|
|
|
2026-07-07 12:17:32 -07:00
|
|
|
// Vec2 datatype for signed x, y coordinates
|
2026-07-08 16:50:17 -07:00
|
|
|
// struct Vec2 {
|
|
|
|
|
// Vec2(int16_t x, int16_t y) {
|
|
|
|
|
// this->x = x;
|
|
|
|
|
// this->y = y;
|
|
|
|
|
// }
|
|
|
|
|
// Vec2() {}
|
|
|
|
|
// int16_t x;
|
|
|
|
|
// int16_t y;
|
|
|
|
|
// };
|
2026-07-07 12:17:32 -07:00
|
|
|
|
2026-07-08 16:50:17 -07:00
|
|
|
// // 2x2 matrix, Q15.16 signed fixed point
|
|
|
|
|
// struct Matrix4 {
|
|
|
|
|
// Matrix4(int32_t xx, int32_t xy, int32_t yx, int32_t yy) {
|
|
|
|
|
// this->xx = xx;
|
|
|
|
|
// this->xy = xy;
|
|
|
|
|
// this->yx = yx;
|
|
|
|
|
// this->yy = yy;
|
|
|
|
|
// }
|
|
|
|
|
// Matrix4() {}
|
|
|
|
|
// int32_t xx; // x' = x*xx + y*xy
|
|
|
|
|
// int32_t xy;
|
|
|
|
|
// int32_t yx; // y' = x*yx + y*yy
|
|
|
|
|
// int32_t yy;
|
|
|
|
|
// };
|
2026-07-07 12:17:32 -07:00
|
|
|
|
|
|
|
|
// class Mapper {
|
|
|
|
|
// public:
|
|
|
|
|
// Mapper() {
|
|
|
|
|
|
2026-07-07 06:47:24 -07:00
|
|
|
// }
|
2026-07-07 12:17:32 -07:00
|
|
|
// uint16_t *xxMap;
|
|
|
|
|
|
2026-07-07 06:47:24 -07:00
|
|
|
// };
|
2026-07-08 13:33:43 -07:00
|
|
|
|
|
|
|
|
enum ShaderType {
|
|
|
|
|
COLOR,
|
|
|
|
|
HGRADIENT,
|
2026-07-08 16:50:17 -07:00
|
|
|
VGRADIENT,
|
|
|
|
|
BUFFER
|
2026-07-08 13:33:43 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum Direction {
|
|
|
|
|
H,
|
|
|
|
|
V
|
|
|
|
|
};
|
2026-07-05 20:55:17 -07:00
|
|
|
}
|