Skip to content

Commit

Permalink
Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Removed OpenGL legacy calls from …
Browse files Browse the repository at this point in the history
…GLCanvas3D::init()
  • Loading branch information
enricoturri1966 committed Feb 10, 2022
1 parent a28dea0 commit aa4714a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/slic3r/GUI/GLCanvas3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,7 @@ bool GLCanvas3D::init()
glsafe(::glEnable(GL_BLEND));
glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));

#if !ENABLE_GLBEGIN_GLEND_REMOVAL
// Set antialiasing / multisampling
glsafe(::glDisable(GL_LINE_SMOOTH));
glsafe(::glDisable(GL_POLYGON_SMOOTH));
Expand Down Expand Up @@ -1186,6 +1187,7 @@ bool GLCanvas3D::init()
// A handy trick -- have surface material mirror the color.
glsafe(::glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE));
glsafe(::glEnable(GL_COLOR_MATERIAL));
#endif // !ENABLE_GLBEGIN_GLEND_REMOVAL

if (m_multisample_allowed)
glsafe(::glEnable(GL_MULTISAMPLE));
Expand Down Expand Up @@ -5868,11 +5870,11 @@ void GLCanvas3D::_render_sla_slices()
if (!bottom_obj_triangles.empty() || !top_obj_triangles.empty() || !bottom_sup_triangles.empty() || !top_sup_triangles.empty()) {
for (const SLAPrintObject::Instance& inst : obj->instances()) {
glsafe(::glPushMatrix());
glsafe(::glTranslated(unscale<double>(inst.shift.x()), unscale<double>(inst.shift.y()), 0));
glsafe(::glRotatef(Geometry::rad2deg(inst.rotation), 0.0, 0.0, 1.0));
glsafe(::glTranslated(unscale<double>(inst.shift.x()), unscale<double>(inst.shift.y()), 0.0));
glsafe(::glRotatef(Geometry::rad2deg(inst.rotation), 0.0f, 0.0f, 1.0f));
if (obj->is_left_handed())
// The polygons are mirrored by X.
glsafe(::glScalef(-1.0, 1.0, 1.0));
glsafe(::glScalef(-1.0f, 1.0f, 1.0f));
glsafe(::glEnableClientState(GL_VERTEX_ARRAY));
glsafe(::glColor3f(1.0f, 0.37f, 0.0f));
if (!bottom_obj_triangles.empty()) {
Expand Down

0 comments on commit aa4714a

Please sign in to comment.