summaryrefslogtreecommitdiffhomepage
path: root/draw
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-23 17:31:31 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-23 17:31:31 +0200
commitcce1f768e7399b838a2b865511915bdd576dbbf4 (patch)
tree4c6a8f2dc9112394fd329d56c0f628ce66b16467 /draw
parent6b875a0919b9932eca9ed877552c34ecb220b7d8 (diff)
a
Diffstat (limited to 'draw')
-rw-r--r--draw/wireframe-mesh.cpp4
-rw-r--r--draw/wireframe-mesh.hpp3
2 files changed, 6 insertions, 1 deletions
diff --git a/draw/wireframe-mesh.cpp b/draw/wireframe-mesh.cpp
index b0ba7676..3fc53c6c 100644
--- a/draw/wireframe-mesh.cpp
+++ b/draw/wireframe-mesh.cpp
@@ -46,5 +46,9 @@ void mesh_base::draw(tile_shader& shader)
shader.draw(_mesh);
}
+void mesh_base::set_subdata(Containers::ArrayView<const void> array)
+{
+ _vertex_buffer.setSubData(0, array);
+}
} // namespace floormat::wireframe
diff --git a/draw/wireframe-mesh.hpp b/draw/wireframe-mesh.hpp
index 67b35ecd..9a8e90c7 100644
--- a/draw/wireframe-mesh.hpp
+++ b/draw/wireframe-mesh.hpp
@@ -36,6 +36,7 @@ struct mesh_base
mesh_base(GL::MeshPrimitive primitive, Containers::ArrayView<const void> index_data,
std::size_t num_vertices, std::size_t num_indexes);
void draw(tile_shader& shader);
+ void set_subdata(Containers::ArrayView<const void> array);
};
} // namespace wireframe
@@ -56,7 +57,7 @@ wireframe_mesh<T>::wireframe_mesh() :
template <wireframe::traits T> void wireframe_mesh<T>::draw(tile_shader& shader, T x)
{
//_vertex_buffer.setData({nullptr, sizeof(Vector3) * T::num_vertices}, GL::BufferUsage::DynamicDraw); // orphan the buffer
- _vertex_buffer.setSubData(0, x.make_vertex_array());
+ set_subdata(x.make_vertex_array());
x.on_draw();
mesh_base::draw(shader);
}