fixed freeze when debug no lines are being rendered
parent
ccf8ae71ef
commit
728a0116db
|
@ -1562,6 +1562,9 @@ void Renderer::paintGL() {
|
||||||
bgfx::copy(path_vertices.data(), sizeof(PathVertex) * path_vertices.size())
|
bgfx::copy(path_vertices.data(), sizeof(PathVertex) * path_vertices.size())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// only render if we actually have lines to draw
|
||||||
|
if (path_vertices.size() > 0)
|
||||||
|
{
|
||||||
std::vector<uint16_t> line_indices;
|
std::vector<uint16_t> line_indices;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (int i = 0; i < (path_vertices.size() / 2) - 1; i++) {
|
for (int i = 0; i < (path_vertices.size() / 2) - 1; i++) {
|
||||||
|
@ -1610,6 +1613,7 @@ void Renderer::paintGL() {
|
||||||
bgfx::setVertexBuffer(path_lines_vbh);
|
bgfx::setVertexBuffer(path_lines_vbh);
|
||||||
bgfx::setState(st.m_state);
|
bgfx::setState(st.m_state);
|
||||||
bgfx::submit(st.m_viewId, st.m_program.program);
|
bgfx::submit(st.m_viewId, st.m_program.program);
|
||||||
|
}
|
||||||
|
|
||||||
// Advance to next frame. Rendering thread will be kicked to
|
// Advance to next frame. Rendering thread will be kicked to
|
||||||
// process submitted rendering primitives.
|
// process submitted rendering primitives.
|
||||||
|
|
Loading…
Reference in New Issue