aboutsummaryrefslogtreecommitdiff
path: root/src/renderer.hpp
diff options
context:
space:
mode:
authorvimene <vincent.menegaux@gmail.com>2026-01-13 02:04:52 +0100
committervimene <vincent.menegaux@gmail.com>2026-01-13 02:04:52 +0100
commitdb41d43345ea73cf7c1bbb29448e52ffb822e3e0 (patch)
tree4635d654e301b3f31f8d2626f3bc2c6f2a6e50a8 /src/renderer.hpp
parent7f08187a46e30925e4563585fab2c6f92400330a (diff)
downloadengine-db41d43345ea73cf7c1bbb29448e52ffb822e3e0.tar.gz
added textures for the hardware renderer
- removed "using" directive in .hpp - reverse order of arguments for quaternion rotation, i.e. q.rot(v) instead of v.rot(q), where q is a quaterinon and v a vector - pass the inverse of the view matrix to render_and_present_frame, to allow light calculation in shaders (we used to just pass the matrix of the quaternion of the transformation, i.e. discard scaling and translations) - added another mesh and texture (viking_room) for testing purposes - added transparent background option - added Quaternion::look_towards(), which is the equivalent of Matrix4::look_at() but only for rotations - various improvement to .obj parsing - load texture coordinates from .obj file - merged duplicate vertices in Mesh::linearize_indices()
Diffstat (limited to 'src/renderer.hpp')
-rw-r--r--src/renderer.hpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/renderer.hpp b/src/renderer.hpp
index ec67489..ea79fce 100644
--- a/src/renderer.hpp
+++ b/src/renderer.hpp
@@ -8,19 +8,16 @@
namespace engine {
-using math::Vector3, o3d::Triangle;
-
template<typename FrameBuffer>
class Renderer {
public:
FrameBuffer fb;
- template<typename FBArg>
- Renderer(FBArg&& fb);
+ Renderer(FrameBuffer&& fb);
void resize(unsigned int w, unsigned int h);
void clear();
- void draw_triangle(const Triangle& triangle);
+ void draw_triangle(const o3d::Triangle& triangle);
constexpr unsigned int width() const & {
return fb.width();