Tech ENABLE_GL_CORE_PROFILE - Use thick_lines shader where needed
Fixed conflicts during rebase with master
This commit is contained in:
parent
389dc36053
commit
017784c38e
14 changed files with 142 additions and 20 deletions
|
@ -179,7 +179,11 @@ void GLGizmoRotate::on_render()
|
|||
glsafe(::glLineWidth((m_hover_id != -1) ? 2.0f : 1.5f));
|
||||
#endif // !ENABLE_GL_CORE_PROFILE
|
||||
#if ENABLE_LEGACY_OPENGL_REMOVAL
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
GLShaderProgram* shader = wxGetApp().get_shader("thick_lines");
|
||||
#else
|
||||
GLShaderProgram* shader = wxGetApp().get_shader("flat");
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
if (shader != nullptr) {
|
||||
shader->start_using();
|
||||
|
||||
|
@ -188,12 +192,17 @@ void GLGizmoRotate::on_render()
|
|||
const Transform3d view_model_matrix = camera.get_view_matrix() * m_grabbers.front().matrix;
|
||||
shader->set_uniform("view_model_matrix", view_model_matrix);
|
||||
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
const std::array<int, 4>& viewport = camera.get_viewport();
|
||||
shader->set_uniform("viewport_size", Vec2d(double(viewport[2]), double(viewport[3])));
|
||||
shader->set_uniform("width", 0.25f);
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
#endif // ENABLE_GL_SHADERS_ATTRIBUTES
|
||||
|
||||
const bool radius_changed = std::abs(m_old_radius - m_radius) > EPSILON;
|
||||
m_old_radius = m_radius;
|
||||
|
||||
ColorRGBA color((m_hover_id != -1) ? m_drag_color : m_highlight_color);
|
||||
const ColorRGBA color = (m_hover_id != -1) ? m_drag_color : m_highlight_color;
|
||||
render_circle(color, radius_changed);
|
||||
if (m_hover_id != -1) {
|
||||
const bool hover_radius_changed = std::abs(m_old_hover_radius - m_radius) > EPSILON;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue