diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-07-26 10:45:22 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-07-26 10:45:22 +0300 |
commit | 77857f7292d9abf648010045efcd6e27fb09ea34 (patch) | |
tree | 2a940c1f86baa89f870b96b99a48746a1ddceea5 /src/slic3r/GUI/3DBed.cpp | |
parent | 9bcdb2ebd059fd91f08aba18fe227afc14017f94 (diff) |
Refactoring into rendering pipeline
Diffstat (limited to 'src/slic3r/GUI/3DBed.cpp')
-rw-r--r-- | src/slic3r/GUI/3DBed.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index a402fa82d..97e200b38 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -266,6 +266,8 @@ void Bed3D::render(GLCanvas3D& canvas, float theta, float scale_factor) const { m_scale_factor = scale_factor; + render_axes(); + switch (m_type) { case MK2: @@ -292,12 +294,6 @@ void Bed3D::render(GLCanvas3D& canvas, float theta, float scale_factor) const } } -void Bed3D::render_axes() const -{ - if (!m_shape.empty()) - m_axes.render(); -} - void Bed3D::calc_bounding_boxes() const { m_bounding_box = BoundingBoxf3(); @@ -393,6 +389,12 @@ Bed3D::EType Bed3D::detect_type(const Pointfs& shape) const return type; } +void Bed3D::render_axes() const +{ + if (!m_shape.empty()) + m_axes.render(); +} + void Bed3D::render_prusa(GLCanvas3D& canvas, const std::string& key, bool bottom) const { if (!bottom) @@ -598,9 +600,7 @@ void Bed3D::render_default(bool bottom) const { bool has_model = !m_model.get_filename().empty(); - glsafe(::glEnable(GL_LIGHTING)); - glsafe(::glDisable(GL_DEPTH_TEST)); - + glsafe(::glEnable(GL_DEPTH_TEST)); glsafe(::glEnable(GL_BLEND)); glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); @@ -615,11 +615,7 @@ void Bed3D::render_default(bool bottom) const glsafe(::glDrawArrays(GL_TRIANGLES, 0, (GLsizei)triangles_vcount)); } - glsafe(::glDisable(GL_LIGHTING)); - // draw grid - // we need depth test for grid, otherwise it would disappear when looking the object from below - glsafe(::glEnable(GL_DEPTH_TEST)); glsafe(::glLineWidth(3.0f * m_scale_factor)); if (has_model && !bottom) glsafe(::glColor4f(0.75f, 0.75f, 0.75f, 1.0f)); |