Tech ENABLE_GL_CORE_PROFILE - Added command line option '--opengl-core=M.m' which allows the user to select a specific OpenGL version supporting core profile

This commit is contained in:
enricoturri1966 2022-05-30 16:15:25 +02:00
parent a1eb8c5cbd
commit 8d0780aabe
20 changed files with 180 additions and 61 deletions

View file

@ -2005,11 +2005,14 @@ void Selection::render_bounding_box(const BoundingBoxf3 & box, float* color) con
glsafe(::glEnable(GL_DEPTH_TEST));
#if ENABLE_GL_CORE_PROFILE
GLShaderProgram* shader = wxGetApp().get_shader("dashed_thick_lines");
if (!OpenGLManager::get_gl_info().is_core_profile())
glsafe(::glLineWidth(2.0f * m_scale_factor));
GLShaderProgram* shader = OpenGLManager::get_gl_info().is_core_profile() ? wxGetApp().get_shader("dashed_thick_lines") : wxGetApp().get_shader("flat");
#else
glsafe(::glLineWidth(2.0f * m_scale_factor));
GLShaderProgram* shader = wxGetApp().get_shader("flat");
#endif // !ENABLE_GL_CORE_PROFILE
#endif // ENABLE_GL_CORE_PROFILE
if (shader == nullptr)
return;