|
|
@@ -12,6 +12,7 @@
|
|
|
#include "game/graphics/object.hpp"
|
|
|
#include "game/graphics/vertex.h"
|
|
|
#include "matrix/matrix.hpp"
|
|
|
+#include "matrix/matrix_helpers.hpp"
|
|
|
#include "renderer_impl.hpp"
|
|
|
|
|
|
using namespace graphics;
|
|
|
@@ -33,9 +34,10 @@ void direct_renderer::draw(object const & obj) {
|
|
|
draw(obj.material, math::matr4(), verts);
|
|
|
}
|
|
|
|
|
|
-void direct_renderer::draw(flyweight<material> material, math::matr4 const &,
|
|
|
+void direct_renderer::draw(flyweight<material> material,
|
|
|
+ math::matr4 const & object_to_world,
|
|
|
std::vector<vertex> const & verts) {
|
|
|
- pimpl->draw(material, {}, verts);
|
|
|
+ pimpl->draw(material, object_to_world, verts);
|
|
|
}
|
|
|
|
|
|
void direct_renderer::clear() { pimpl->clear(); }
|
|
|
@@ -74,7 +76,7 @@ void batch_renderer::check() {
|
|
|
|
|
|
void batch_renderer::write() {
|
|
|
for (auto & pair : batches_) {
|
|
|
- impl_->draw(pair.first, math::matr4(), pair.second);
|
|
|
+ impl_->draw(pair.first, math::matrix::identity<float, 4>(), pair.second);
|
|
|
}
|
|
|
batches_.clear();
|
|
|
elements_ = 0;
|