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

@ -132,7 +132,7 @@ void GLGizmoMove3D::on_render()
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.color = AXES_COLOR[id];
init_data.reserve_vertices(2);
init_data.reserve_indices(2);
@ -142,7 +142,7 @@ void GLGizmoMove3D::on_render()
init_data.add_vertex((Vec3f)m_grabbers[id].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));
}