Fix crash in rendering orbits again

pull/923/head
Levin Li 2021-02-26 15:15:38 +08:00
parent 52cb444d02
commit f761c59f32
1 changed files with 2 additions and 2 deletions

View File

@ -330,12 +330,12 @@ public:
#if USE_VERTEX_BUFFER
if (currentPosition > 0)
{
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vertex) * (currentPosition + 1) * 2, data);
// Finish the current line strip
if (endIfNeeded && currentStripLength > 1)
end(false);
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Vertex) * currentPosition * 2, data);
unsigned int startIndex = 0;
for (vector<unsigned int>::const_iterator iter = stripLengths.begin(); iter != stripLengths.end(); ++iter)
{