mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 01:37:53 -06:00
Tech ENABLE_LEGACY_OPENGL_REMOVAL - Fixed rendering of layer editing background on older OpenGL compatibility profile
(cherry picked from commit prusa3d/PrusaSlicer@642f64cb41)
This commit is contained in:
parent
19ad0ca4d9
commit
461fa63cbf
3 changed files with 62 additions and 37 deletions
|
@ -421,7 +421,7 @@ void GLCanvas3D::LayersEditing::render_active_object_annotations(const GLCanvas3
|
|||
m_profile.background.reset();
|
||||
|
||||
GLModel::Geometry init_data;
|
||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P2T2 };
|
||||
init_data.format = { GLModel::Geometry::EPrimitiveType::Triangles, GLModel::Geometry::EVertexLayout::P3N3T2 };
|
||||
init_data.reserve_vertices(4);
|
||||
init_data.reserve_indices(6);
|
||||
|
||||
|
@ -430,10 +430,10 @@ void GLCanvas3D::LayersEditing::render_active_object_annotations(const GLCanvas3
|
|||
const float r = 1.0f;
|
||||
const float t = 1.0f;
|
||||
const float b = -1.0f;
|
||||
init_data.add_vertex(Vec2f(l, b), Vec2f(0.0f, 0.0f));
|
||||
init_data.add_vertex(Vec2f(r, b), Vec2f(1.0f, 0.0f));
|
||||
init_data.add_vertex(Vec2f(r, t), Vec2f(1.0f, 1.0f));
|
||||
init_data.add_vertex(Vec2f(l, t), Vec2f(0.0f, 1.0f));
|
||||
init_data.add_vertex(Vec3f(l, b, 0.0f), Vec3f::UnitZ(), Vec2f(0.0f, 0.0f));
|
||||
init_data.add_vertex(Vec3f(r, b, 0.0f), Vec3f::UnitZ(), Vec2f(1.0f, 0.0f));
|
||||
init_data.add_vertex(Vec3f(r, t, 0.0f), Vec3f::UnitZ(), Vec2f(1.0f, 1.0f));
|
||||
init_data.add_vertex(Vec3f(l, t, 0.0f), Vec3f::UnitZ(), Vec2f(0.0f, 1.0f));
|
||||
|
||||
// indices
|
||||
init_data.add_triangle(0, 1, 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue