Tech ENABLE_LEGACY_OPENGL_REMOVAL - Refactoring of GLModel to automatically detect the data type to use into the index buffer in dependence of vertices count

This commit is contained in:
enricoturri1966 2022-03-09 11:51:02 +01:00
parent 46283cfde3
commit f8ce187262
16 changed files with 416 additions and 591 deletions

View file

@ -515,7 +515,7 @@ void GLGizmoScale3D::render_grabbers_connection(unsigned int id_1, unsigned int
m_grabber_connections[id].model.reset();
GLModel::Geometry init_data;
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3 };
init_data.reserve_vertices(2);
init_data.reserve_indices(2);
@ -524,7 +524,7 @@ void GLGizmoScale3D::render_grabbers_connection(unsigned int id_1, unsigned int
init_data.add_vertex((Vec3f)m_grabbers[id_2].center.cast<float>());
// indices
init_data.add_ushort_line(0, 1);
init_data.add_line(0, 1);
m_grabber_connections[id].model.init_from(std::move(init_data));
}