diff options
| author | vimene <vincent.menegaux@gmail.com> | 2026-01-17 00:06:31 +0100 |
|---|---|---|
| committer | vimene <vincent.menegaux@gmail.com> | 2026-01-17 00:06:31 +0100 |
| commit | 0d10b77f77459333c5549711334f417623ab1f3e (patch) | |
| tree | 6584ab5d09fa72c93a70ac916bfdf401c7617157 /src/shaders/simple_shaders.cpp | |
| parent | 175c71637b6bea6dcdd0faf3d614339983809bb1 (diff) | |
| download | engine-0d10b77f77459333c5549711334f417623ab1f3e.tar.gz | |
improved software shaders
- unified terminal and graphical software renderer shaders
- added vertex shaders for software renderers
- removed VertexData
- moved shaders from frame buffers to their own class
- added FrameBufferConcept and ShadersConcept
Diffstat (limited to 'src/shaders/simple_shaders.cpp')
| -rw-r--r-- | src/shaders/simple_shaders.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/shaders/simple_shaders.cpp b/src/shaders/simple_shaders.cpp new file mode 100644 index 0000000..ebbec31 --- /dev/null +++ b/src/shaders/simple_shaders.cpp @@ -0,0 +1,18 @@ +#include "shaders/simple_shaders.hpp" +#include "math/mat4.hpp" + +using namespace engine::shaders; +using engine::math::Matrix4; + +SimpleShaders::SimpleShaders(int w, int h, unsigned char* pixels) : w { w }, h { h }, pixels { pixels } { +} + +void SimpleShaders::set_view(const Matrix4& view_mat, const Matrix4& proj_mat) { + this->view_mat = view_mat; + this->proj_mat = proj_mat; +} + +void SimpleShaders::set_model(const Matrix4& model_mat) { + this->model_mat = model_mat; + final_mat = proj_mat * view_mat * model_mat; +} |
