Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Fix in GLGizmoRotate::render_angle_arc():
Tech ENABLE_GLINDEXEDVERTEXARRAY_REMOVAL - Fix in GLModel::render()
This commit is contained in:
parent
1e9951dec5
commit
2379588196
@ -998,7 +998,7 @@ void GLModel::render(const std::pair<size_t, size_t>& range)
|
|||||||
shader->set_uniform("uniform_color", data.color);
|
shader->set_uniform("uniform_color", data.color);
|
||||||
|
|
||||||
glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_render_data.ibo_id));
|
glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_render_data.ibo_id));
|
||||||
glsafe(::glDrawElements(mode, range.second - range.first + 1, index_type, (const void*)(range.first * Geometry::index_stride_bytes(data.format))));
|
glsafe(::glDrawElements(mode, range.second - range.first, index_type, (const void*)(range.first * Geometry::index_stride_bytes(data.format))));
|
||||||
glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));
|
glsafe(::glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));
|
||||||
|
|
||||||
if (tex_coord)
|
if (tex_coord)
|
||||||
|
@ -461,9 +461,12 @@ void GLGizmoRotate::render_angle() const
|
|||||||
const float ex_radius = m_radius * (1.0f + GrabberOffset);
|
const float ex_radius = m_radius * (1.0f + GrabberOffset);
|
||||||
|
|
||||||
#if ENABLE_GLBEGIN_GLEND_REMOVAL
|
#if ENABLE_GLBEGIN_GLEND_REMOVAL
|
||||||
if (!m_angle_arc.is_initialized() || radius_changed) {
|
const bool angle_changed = std::abs(m_old_angle - m_angle) > EPSILON;
|
||||||
m_angle_arc.reset();
|
m_old_angle = m_angle;
|
||||||
|
|
||||||
|
if (!m_angle_arc.is_initialized() || radius_changed || angle_changed) {
|
||||||
|
m_angle_arc.reset();
|
||||||
|
if (m_angle > 0.0f) {
|
||||||
GLModel::Geometry init_data;
|
GLModel::Geometry init_data;
|
||||||
init_data.format = { GLModel::Geometry::EPrimitiveType::LineStrip, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
init_data.format = { GLModel::Geometry::EPrimitiveType::LineStrip, GLModel::Geometry::EVertexLayout::P3, GLModel::Geometry::EIndexType::USHORT };
|
||||||
init_data.reserve_vertices(1 + AngleResolution);
|
init_data.reserve_vertices(1 + AngleResolution);
|
||||||
@ -478,6 +481,7 @@ void GLGizmoRotate::render_angle() const
|
|||||||
|
|
||||||
m_angle_arc.init_from(std::move(init_data));
|
m_angle_arc.init_from(std::move(init_data));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_angle_arc.set_color(color);
|
m_angle_arc.set_color(color);
|
||||||
m_angle_arc.render();
|
m_angle_arc.render();
|
||||||
|
@ -50,6 +50,7 @@ private:
|
|||||||
GrabberConnection m_grabber_connection;
|
GrabberConnection m_grabber_connection;
|
||||||
float m_old_radius{ 0.0f };
|
float m_old_radius{ 0.0f };
|
||||||
float m_old_hover_radius{ 0.0f };
|
float m_old_hover_radius{ 0.0f };
|
||||||
|
float m_old_angle{ 0.0f };
|
||||||
#endif // ENABLE_GLBEGIN_GLEND_REMOVAL
|
#endif // ENABLE_GLBEGIN_GLEND_REMOVAL
|
||||||
|
|
||||||
ColorRGBA m_drag_color;
|
ColorRGBA m_drag_color;
|
||||||
|
Loading…
Reference in New Issue
Block a user