mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
More OpenGL Core Profile fixes
This commit is contained in:
@@ -989,11 +989,19 @@ void GLGizmoAdvancedCut::render_cut_plane_and_grabbers()
|
|||||||
}
|
}
|
||||||
|
|
||||||
glsafe(::glDisable(GL_DEPTH_TEST));
|
glsafe(::glDisable(GL_DEPTH_TEST));
|
||||||
glsafe(::glLineWidth(m_hover_id != -1 ? 2.0f : 1.5f));
|
// ORCA: OpenGL Core Profile
|
||||||
glLineStipple(1, 0x0FFF);
|
#if !SLIC3R_OPENGL_ES
|
||||||
glEnable(GL_LINE_STIPPLE);
|
if (!OpenGLManager::get_gl_info().is_core_profile()) {
|
||||||
|
glsafe(::glLineWidth(m_hover_id != -1 ? 2.0f : 1.5f));
|
||||||
|
glLineStipple(1, 0x0FFF);
|
||||||
|
glEnable(GL_LINE_STIPPLE);
|
||||||
|
}
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
m_grabber_connection.render();
|
m_grabber_connection.render();
|
||||||
glDisable(GL_LINE_STIPPLE);
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||||
|
glDisable(GL_LINE_STIPPLE);
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
|
|
||||||
shader->stop_using();
|
shader->stop_using();
|
||||||
}
|
}
|
||||||
@@ -1147,10 +1155,18 @@ void GLGizmoAdvancedCut::render_cut_line()
|
|||||||
shader->set_uniform("view_model_matrix", camera.get_view_matrix());
|
shader->set_uniform("view_model_matrix", camera.get_view_matrix());
|
||||||
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||||
|
|
||||||
glEnable(GL_LINE_STIPPLE);
|
// ORCA: OpenGL Core Profile
|
||||||
glLineStipple(1, 0x0FFF);
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile()) {
|
||||||
|
glEnable(GL_LINE_STIPPLE);
|
||||||
|
glLineStipple(1, 0x0FFF);
|
||||||
|
}
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
m_cut_line.render();
|
m_cut_line.render();
|
||||||
glDisable(GL_LINE_STIPPLE);
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||||
|
glDisable(GL_LINE_STIPPLE);
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
|
|
||||||
shader->stop_using();
|
shader->stop_using();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -231,7 +231,11 @@ void GLGizmoBase::render_cross_mark(const Vec3f &target, bool is_single)
|
|||||||
{
|
{
|
||||||
const float half_length = 4.0f;
|
const float half_length = 4.0f;
|
||||||
|
|
||||||
glsafe(::glLineWidth(2.0f));
|
// ORCA: OpenGL Core Profile
|
||||||
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||||
|
glsafe(::glLineWidth(2.0f));
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
|
|
||||||
auto render_line = [](const Vec3f& p1, const Vec3f& p2, const ColorRGBA& color) {
|
auto render_line = [](const Vec3f& p1, const Vec3f& p2, const ColorRGBA& color) {
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
|
|||||||
@@ -188,10 +188,18 @@ void GLGizmoMove3D::on_render()
|
|||||||
m_grabber_connections[id].model.init_from(std::move(init_data));
|
m_grabber_connections[id].model.init_from(std::move(init_data));
|
||||||
//}
|
//}
|
||||||
|
|
||||||
glLineStipple(1, 0x0FFF);
|
// ORCA: OpenGL Core Profile
|
||||||
glEnable(GL_LINE_STIPPLE);
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile()) {
|
||||||
|
glLineStipple(1, 0x0FFF);
|
||||||
|
glEnable(GL_LINE_STIPPLE);
|
||||||
|
}
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
m_grabber_connections[id].model.render();
|
m_grabber_connections[id].model.render();
|
||||||
glDisable(GL_LINE_STIPPLE);
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||||
|
glDisable(GL_LINE_STIPPLE);
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -392,7 +392,11 @@ void GLGizmoPainterBase::render_cursor_height_range(const Transform3d& trafo) co
|
|||||||
|
|
||||||
shader->set_uniform("view_model_matrix", view_model_matrix);
|
shader->set_uniform("view_model_matrix", view_model_matrix);
|
||||||
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||||
glsafe(::glLineWidth(2.0f));
|
// ORCA: OpenGL Core Profile
|
||||||
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||||
|
glsafe(::glLineWidth(2.0f));
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
m_cut_contours[m_volumes_index].contours.render();
|
m_cut_contours[m_volumes_index].contours.render();
|
||||||
m_volumes_index++;
|
m_volumes_index++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -390,10 +390,18 @@ void GLGizmoScale3D::render_grabbers_connection(unsigned int id_1, unsigned int
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_grabber_connections[id].model.set_color(color);
|
m_grabber_connections[id].model.set_color(color);
|
||||||
glLineStipple(1, 0x0FFF);
|
// ORCA: OpenGL Core Profile
|
||||||
glEnable(GL_LINE_STIPPLE);
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile()) {
|
||||||
|
glLineStipple(1, 0x0FFF);
|
||||||
|
glEnable(GL_LINE_STIPPLE);
|
||||||
|
}
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
m_grabber_connections[id].model.render();
|
m_grabber_connections[id].model.render();
|
||||||
glDisable(GL_LINE_STIPPLE);
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||||
|
glDisable(GL_LINE_STIPPLE);
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
}
|
}
|
||||||
|
|
||||||
//BBS: add input window for move
|
//BBS: add input window for move
|
||||||
|
|||||||
@@ -950,20 +950,32 @@ void PartPlate::render_height_limit(PartPlate::HeightLimitMode mode)
|
|||||||
if (m_print && m_print->config().print_sequence == PrintSequence::ByObject && mode != HEIGHT_LIMIT_NONE)
|
if (m_print && m_print->config().print_sequence == PrintSequence::ByObject && mode != HEIGHT_LIMIT_NONE)
|
||||||
{
|
{
|
||||||
// draw lower limit
|
// draw lower limit
|
||||||
glsafe(::glLineWidth(3.0f * m_scale_factor));
|
// ORCA: OpenGL Core Profile
|
||||||
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||||
|
glsafe(::glLineWidth(3.0f * m_scale_factor));
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
m_height_limit_common.set_color(HEIGHT_LIMIT_BOTTOM_COLOR);
|
m_height_limit_common.set_color(HEIGHT_LIMIT_BOTTOM_COLOR);
|
||||||
m_height_limit_common.render();
|
m_height_limit_common.render();
|
||||||
|
|
||||||
if ((mode == HEIGHT_LIMIT_BOTTOM) || (mode == HEIGHT_LIMIT_BOTH)) {
|
if ((mode == HEIGHT_LIMIT_BOTTOM) || (mode == HEIGHT_LIMIT_BOTH)) {
|
||||||
glsafe(::glLineWidth(3.0f * m_scale_factor));
|
// ORCA: OpenGL Core Profile
|
||||||
m_height_limit_bottom.set_color(HEIGHT_LIMIT_BOTTOM_COLOR);
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||||
|
glsafe(::glLineWidth(3.0f * m_scale_factor));
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
|
m_height_limit_bottom.set_color(HEIGHT_LIMIT_BOTTOM_COLOR);
|
||||||
m_height_limit_bottom.render();
|
m_height_limit_bottom.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw upper limit
|
// draw upper limit
|
||||||
if ((mode == HEIGHT_LIMIT_TOP) || (mode == HEIGHT_LIMIT_BOTH)){
|
if ((mode == HEIGHT_LIMIT_TOP) || (mode == HEIGHT_LIMIT_BOTH)){
|
||||||
glsafe(::glLineWidth(3.0f * m_scale_factor));
|
// ORCA: OpenGL Core Profile
|
||||||
m_height_limit_top.set_color(HEIGHT_LIMIT_TOP_COLOR);
|
#if !SLIC3R_OPENGL_ES
|
||||||
|
if (!OpenGLManager::get_gl_info().is_core_profile())
|
||||||
|
glsafe(::glLineWidth(3.0f * m_scale_factor));
|
||||||
|
#endif // !SLIC3R_OPENGL_ES
|
||||||
|
m_height_limit_top.set_color(HEIGHT_LIMIT_TOP_COLOR);
|
||||||
m_height_limit_top.render();
|
m_height_limit_top.render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user