CRTP shaders on Lines

This commit is contained in:
2026-07-20 02:04:17 -07:00
parent 0f0e352fca
commit 3588a41657
4 changed files with 46 additions and 155 deletions
+17 -13
View File
@@ -45,6 +45,10 @@ int main(void) {
UwU::ColorShader green = UwU::ColorShader(UwU::Color(0x00ff00ff));
UwU::Point point = UwU::Point(187, 37);
point.draw(surface.buffer, green);
UwU::ColorShader blue = UwU::ColorShader(UwU::Color(0x0000ffff));
UwU::Trapezoid trapezoid = UwU::Trapezoid(100, 300, 690, 320, 720, 780);
trapezoid.draw(surface.buffer, blue);
// // Benchmarking
// struct timespec start, end;
@@ -73,20 +77,20 @@ int main(void) {
// printf("Elapsed: %ld ns\n", timeAvg);
// UwU::Line lines[8] {
// UwU::Line(300, 100, 250, 469),
// UwU::Line(250, 100, 300, 469),
// UwU::Line(300, 100, 469, 250),
// UwU::Line(469, 100, 300, 250),
// UwU::Line(100, 300, 250, 469),
// UwU::Line(250, 300, 100, 469),
// UwU::Line(100, 300, 469, 250),
// UwU::Line(469, 300, 100, 250)
// };
UwU::Line lines[8] {
UwU::Line(300, 100, 250, 469),
UwU::Line(250, 100, 300, 469),
UwU::Line(300, 100, 469, 250),
UwU::Line(469, 100, 300, 250),
UwU::Line(100, 300, 250, 469),
UwU::Line(250, 300, 100, 469),
UwU::Line(100, 300, 469, 250),
UwU::Line(469, 300, 100, 250)
};
// for (uint16_t i = 0; i < 8; i++) {
// lines[i].draw(surface.buffer, bisexual);
// }
for (uint16_t i = 0; i < 8; i++) {
lines[i].draw(surface.buffer, blue);
}
surface.present();