implemented CRTP shader on ColorShader and Rectangle

This commit is contained in:
2026-07-20 01:41:10 -07:00
parent b95022de29
commit 444143ced9
9 changed files with 132 additions and 151 deletions
+2 -2
View File
@@ -7,11 +7,11 @@
#include "../buffer.cpp"
namespace UwU {
template <typename Derived>
template <class ShaderT>
class ShaderBase {
public:
Color shade(uint16_t x, uint16_t y) {
return static_cast<Derived*>(this)->shade(x, y);
return static_cast<ShaderT*>(this)->shade(x, y);
}
};
}