implemented shaders, gradients, and uv mapping

This commit is contained in:
2026-07-07 12:17:32 -07:00
parent 989cb196ed
commit ad2e84c279
10 changed files with 149 additions and 27 deletions
+32 -16
View File
@@ -36,22 +36,38 @@ namespace UwU {
uint16_t y;
};
// // trapezoid datatype (horizontally constrained)
// struct Trapezoid {
// Trapezoid(uint16_t y0, uint16_t y1, uint16_t xl0, uint16_t xl1, uint16_t xr0, uint16_t xr1) {
// this->y0 = y0;
// this->y1 = y1;
// this->xl0 = xl0;
// this->xl1 = xl1;
// this->xr0 = xr0;
// this->xr1 = xr1;
// Vec2 datatype for signed x, y coordinates
struct Vec2 {
Vec2(int16_t x, int16_t y) {
this->x = x;
this->y = y;
}
Vec2() {}
int16_t x;
int16_t y;
};
// 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;
};
// class Mapper {
// public:
// Mapper() {
// }
// Trapezoid() {}
// uint16_t y0;
// uint16_t y1;
// uint16_t xl0;
// uint16_t xl1;
// uint16_t xr0;
// uint16_t xr1;
// uint16_t *xxMap;
// };
}