stubbed out CRTP shaders
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "../datatypes.cpp"
|
||||
#include "../helpers.cpp"
|
||||
#include "../buffer.cpp"
|
||||
#include "shaderbase.cpp"
|
||||
|
||||
namespace UwU {
|
||||
class ColorShader : public ShaderBase<ColorShader> {
|
||||
public:
|
||||
ColorShader(Color c) {
|
||||
this->c = c;
|
||||
}
|
||||
Color c;
|
||||
|
||||
Color shade(uint16_t x, uint16_t y) {
|
||||
return c;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "../datatypes.cpp"
|
||||
#include "../helpers.cpp"
|
||||
#include "../buffer.cpp"
|
||||
|
||||
namespace UwU {
|
||||
template <typename Derived>
|
||||
class ShaderBase {
|
||||
public:
|
||||
Color shade(uint16_t x, uint16_t y) {
|
||||
return static_cast<Derived*>(this)->shade(x, y);
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user