From 11da45e32fb623a8a2717964f091f998c13b692e Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Thu, 20 Dec 2018 11:42:26 +0100 Subject: [PATCH] Visual hints in the 3D scene when sidebar matrix fields have focus -> legacy render case --- src/slic3r/GUI/3DScene.cpp | 22 ++++++++++++++++++++-- src/slic3r/GUI/3DScene.hpp | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index b431cf8bc..961d4822a 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -1920,8 +1920,7 @@ void GLModel::render() const if (m_useVBOs) render_VBOs(); else - { - } + render_legacy(); } void GLModel::render_VBOs() const @@ -1949,6 +1948,25 @@ void GLModel::render_VBOs() const ::glDisable(GL_BLEND); } +void GLModel::render_legacy() const +{ + ::glEnable(GL_LIGHTING); + ::glEnable(GL_BLEND); + ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + ::glCullFace(GL_BACK); + ::glEnableClientState(GL_VERTEX_ARRAY); + ::glEnableClientState(GL_NORMAL_ARRAY); + + m_volume.render_legacy(); + + ::glDisableClientState(GL_VERTEX_ARRAY); + ::glDisableClientState(GL_NORMAL_ARRAY); + + ::glDisable(GL_BLEND); + ::glDisable(GL_LIGHTING); +} + bool GLArrow::on_init(bool useVBOs) { Pointf3s vertices; diff --git a/src/slic3r/GUI/3DScene.hpp b/src/slic3r/GUI/3DScene.hpp index 09bb54e2f..76cacabbd 100644 --- a/src/slic3r/GUI/3DScene.hpp +++ b/src/slic3r/GUI/3DScene.hpp @@ -611,6 +611,7 @@ protected: private: void render_VBOs() const; + void render_legacy() const; }; class GLArrow : public GLModel