added mappers to rest of primatives
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "../helpers.cpp"
|
||||
#include "../buffer.cpp"
|
||||
#include "../shaders/shaders.h"
|
||||
#include "../mappers/mappers.h"
|
||||
|
||||
namespace UwU {
|
||||
// point
|
||||
@@ -20,10 +21,11 @@ namespace UwU {
|
||||
uint16_t y;
|
||||
|
||||
// Draw a point
|
||||
template <class ShaderT>
|
||||
void draw (Buffer buffer, ShaderBase<ShaderT>& shader) {
|
||||
template <class MapperT, class ShaderT>
|
||||
void draw (Buffer buffer, MapperBase<MapperT>& mapper, ShaderBase<ShaderT>& shader) {
|
||||
if (x > buffer.width || y > buffer.height) {return;};
|
||||
buffer.drawPixel(x, y, shader.shade(x, y));
|
||||
Coord2 uv = mapper.map(x, y);
|
||||
buffer.drawPixel(x, y, shader.shade(uv.x, uv.y));
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user