created buffer shader and added shader logic to rectangle

This commit is contained in:
2026-07-08 16:50:17 -07:00
parent 43c893984f
commit 89afdfce9b
9 changed files with 73 additions and 50 deletions
+34 -33
View File
@@ -26,41 +26,41 @@ namespace UwU {
};
// Coord2 datatype for xy coordinates, from top-left of surface
struct Coord2 {
Coord2(uint16_t x, uint16_t y) {
this->x = x;
this->y = y;
}
Coord2() {}
uint16_t x;
uint16_t y;
};
// struct Coord2 {
// Coord2(uint16_t x, uint16_t y) {
// this->x = x;
// this->y = y;
// }
// Coord2() {}
// uint16_t x;
// uint16_t y;
// };
// 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;
};
// 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;
};
// // 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:
@@ -74,7 +74,8 @@ namespace UwU {
enum ShaderType {
COLOR,
HGRADIENT,
VGRADIENT
VGRADIENT,
BUFFER
};
enum Direction {