summaryrefslogtreecommitdiffhomepage
path: root/draw
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-09 07:49:42 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-09 07:49:42 +0200
commitf6d822abd400d7a61ccacb49df75212132bcec66 (patch)
tree7444b5f8ace3ea97804b55e3247af09da8bfca55 /draw
parent5b97a6de06e7c44e7960159dc98c54860170203b (diff)
a
Diffstat (limited to 'draw')
-rw-r--r--draw/wireframe-box.cpp16
-rw-r--r--draw/wireframe-mesh.hpp1
2 files changed, 9 insertions, 8 deletions
diff --git a/draw/wireframe-box.cpp b/draw/wireframe-box.cpp
index e03c8ca2..c5e4d9ac 100644
--- a/draw/wireframe-box.cpp
+++ b/draw/wireframe-box.cpp
@@ -16,14 +16,14 @@ box::vertex_array box::make_vertex_array() const
const auto Cy_0 = center[1] - Sy, Cy_1 = center[1] + Sy;
const auto Cz_0 = center[2] + 0, Cz_1 = center[2] + Sz;
return {{
- {Cx_0, Cy_0, Cz_0}, // (0) left front bottom
- {Cx_1, Cy_0, Cz_0}, // (1) right front bottom
- {Cx_0, Cy_1, Cz_0}, // (2) left back bottom
- {Cx_1, Cy_1, Cz_0}, // (3) right back bottom
- {Cx_0, Cy_0, Cz_1}, // (4) left front top
- {Cx_1, Cy_0, Cz_1}, // (5) right front top
- {Cx_0, Cy_1, Cz_1}, // (6) left back top
- {Cx_1, Cy_1, Cz_1}, // (7) right back top
+ {Cx_0, Cy_0, Cz_0}, // (0) front left bottom
+ {Cx_1, Cy_0, Cz_0}, // (1) front right bottom
+ {Cx_0, Cy_1, Cz_0}, // (2) back left bottom
+ {Cx_1, Cy_1, Cz_0}, // (3) back right bottom
+ {Cx_0, Cy_0, Cz_1}, // (4) front left top
+ {Cx_1, Cy_0, Cz_1}, // (5) front right top
+ {Cx_0, Cy_1, Cz_1}, // (6) back left top
+ {Cx_1, Cy_1, Cz_1}, // (7) back right top
}};
}
diff --git a/draw/wireframe-mesh.hpp b/draw/wireframe-mesh.hpp
index 016a92af..f9c5e369 100644
--- a/draw/wireframe-mesh.hpp
+++ b/draw/wireframe-mesh.hpp
@@ -56,6 +56,7 @@ wireframe_mesh<T>::wireframe_mesh() :
template <wireframe::traits T> void wireframe_mesh<T>::draw(tile_shader& shader, T x)
{
_vertex_buffer.setSubData(0, x.make_vertex_array());
+ x.on_draw();
mesh_base::draw(shader);
}