Rendering seams (and other options) in preview using batched models on systems not supporting OpenGL 3.3

This commit is contained in:
enricoturri1966 2021-09-03 15:35:44 +02:00
parent e630332e24
commit 7f2d1522ce
6 changed files with 351 additions and 13 deletions
src/slic3r/GUI

View file

@ -19,6 +19,26 @@
namespace Slic3r {
namespace GUI {
#if ENABLE_SEAMS_USING_BATCHED_MODELS
size_t GLModel::InitializationData::vertices_count() const
{
size_t ret = 0;
for (const Entity& entity : entities) {
ret += entity.positions.size();
}
return ret;
}
size_t GLModel::InitializationData::indices_count() const
{
size_t ret = 0;
for (const Entity& entity : entities) {
ret += entity.indices.size();
}
return ret;
}
#endif // ENABLE_SEAMS_USING_BATCHED_MODELS
void GLModel::init_from(const InitializationData& data)
{
if (!m_render_data.empty()) // call reset() if you want to reuse this model