fixed freeze when debug no lines are being rendered

master
Martin Felis 2016-12-22 23:24:07 +01:00
parent ccf8ae71ef
commit 728a0116db
1 changed files with 16 additions and 12 deletions

View File

@ -1562,6 +1562,9 @@ void Renderer::paintGL() {
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;
int index = 0;
for (int i = 0; i < (path_vertices.size() / 2) - 1; i++) {
@ -1610,6 +1613,7 @@ void Renderer::paintGL() {
bgfx::setVertexBuffer(path_lines_vbh);
bgfx::setState(st.m_state);
bgfx::submit(st.m_viewId, st.m_program.program);
}
// Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.