Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_opengl_3
This commit is contained in:
commit
bf57d022d4
@ -597,10 +597,7 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas)
|
|||||||
if (bottom)
|
if (bottom)
|
||||||
glsafe(::glFrontFace(GL_CW));
|
glsafe(::glFrontFace(GL_CW));
|
||||||
|
|
||||||
unsigned int stride = m_triangles.get_vertex_data_size();
|
const unsigned int stride = m_triangles.get_vertex_data_size();
|
||||||
|
|
||||||
GLint position_id = shader->get_attrib_location("v_position");
|
|
||||||
GLint tex_coords_id = shader->get_attrib_location("v_tex_coords");
|
|
||||||
|
|
||||||
// show the temporary texture while no compressed data is available
|
// show the temporary texture while no compressed data is available
|
||||||
GLuint tex_id = (GLuint)m_temp_texture.get_id();
|
GLuint tex_id = (GLuint)m_temp_texture.get_id();
|
||||||
@ -610,22 +607,16 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas)
|
|||||||
glsafe(::glBindTexture(GL_TEXTURE_2D, tex_id));
|
glsafe(::glBindTexture(GL_TEXTURE_2D, tex_id));
|
||||||
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, m_vbo_id));
|
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, m_vbo_id));
|
||||||
|
|
||||||
if (position_id != -1) {
|
glsafe(::glVertexPointer(3, GL_FLOAT, stride, (const void*)(intptr_t)m_triangles.get_position_offset()));
|
||||||
glsafe(::glEnableVertexAttribArray(position_id));
|
glsafe(::glEnableClientState(GL_VERTEX_ARRAY));
|
||||||
glsafe(::glVertexAttribPointer(position_id, 3, GL_FLOAT, GL_FALSE, stride, (GLvoid*)(intptr_t)m_triangles.get_position_offset()));
|
|
||||||
}
|
glsafe(::glTexCoordPointer(2, GL_FLOAT, stride, (const void*)(intptr_t)m_triangles.get_tex_coords_offset()));
|
||||||
if (tex_coords_id != -1) {
|
glsafe(::glEnableClientState(GL_TEXTURE_COORD_ARRAY));
|
||||||
glsafe(::glEnableVertexAttribArray(tex_coords_id));
|
|
||||||
glsafe(::glVertexAttribPointer(tex_coords_id, 2, GL_FLOAT, GL_FALSE, stride, (GLvoid*)(intptr_t)m_triangles.get_tex_coords_offset()));
|
|
||||||
}
|
|
||||||
|
|
||||||
glsafe(::glDrawArrays(GL_TRIANGLES, 0, (GLsizei)m_triangles.get_vertices_count()));
|
glsafe(::glDrawArrays(GL_TRIANGLES, 0, (GLsizei)m_triangles.get_vertices_count()));
|
||||||
|
|
||||||
if (tex_coords_id != -1)
|
glsafe(::glDisableClientState(GL_TEXTURE_COORD_ARRAY));
|
||||||
glsafe(::glDisableVertexAttribArray(tex_coords_id));
|
glsafe(::glDisableClientState(GL_VERTEX_ARRAY));
|
||||||
|
|
||||||
if (position_id != -1)
|
|
||||||
glsafe(::glDisableVertexAttribArray(position_id));
|
|
||||||
|
|
||||||
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
|
glsafe(::glBindBuffer(GL_ARRAY_BUFFER, 0));
|
||||||
glsafe(::glBindTexture(GL_TEXTURE_2D, 0));
|
glsafe(::glBindTexture(GL_TEXTURE_2D, 0));
|
||||||
|
@ -1210,11 +1210,11 @@ void TriangleSelectorGUI::render_debug(ImGuiWrapper* imgui)
|
|||||||
m_varrays[i].init_from(std::move(varrays_data[i]));
|
m_varrays[i].init_from(std::move(varrays_data[i]));
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
for (auto* iva : { &m_iva_enforcers, &m_iva_blockers })
|
// for (auto* iva : { &m_iva_enforcers, &m_iva_blockers })
|
||||||
iva->finalize_geometry(true);
|
// iva->finalize_geometry(true);
|
||||||
|
//
|
||||||
for (auto& iva : m_iva_seed_fills)
|
// for (auto& iva : m_iva_seed_fills)
|
||||||
iva.finalize_geometry(true);
|
// iva.finalize_geometry(true);
|
||||||
#endif // ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
#endif // ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
||||||
|
|
||||||
#if ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
#if ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL
|
||||||
|
@ -245,7 +245,7 @@ void GLGizmoSlaSupports::render_points(const Selection& selection, bool picking)
|
|||||||
m_cylinder.set_color(render_color);
|
m_cylinder.set_color(render_color);
|
||||||
#else
|
#else
|
||||||
m_cylinder.set_color(-1, render_color);
|
m_cylinder.set_color(-1, render_color);
|
||||||
if (shader != nu)
|
if (shader != nullptr)
|
||||||
#endif // ENABLE_GLBEGIN_GLEND_REMOVAL
|
#endif // ENABLE_GLBEGIN_GLEND_REMOVAL
|
||||||
shader->set_uniform("emission_factor", 0.5f);
|
shader->set_uniform("emission_factor", 0.5f);
|
||||||
for (const sla::DrainHole& drain_hole : m_c->selection_info()->model_object()->sla_drain_holes) {
|
for (const sla::DrainHole& drain_hole : m_c->selection_info()->model_object()->sla_drain_holes) {
|
||||||
|
Loading…
Reference in New Issue
Block a user