浏览代码

OpenGL3 example: fix growing of VBO

ocornut 10 年之前
父节点
当前提交
b3febabc30
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/opengl3_example/main.cpp

+ 1 - 1
examples/opengl3_example/main.cpp

@@ -69,7 +69,7 @@ static void ImImpl_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_c
     if (neededBufferSize > vbo_max_size)
     {
         vbo_max_size = neededBufferSize + 5000;  // Grow buffer
-        glBufferData(GL_ARRAY_BUFFER, neededBufferSize, NULL, GL_STREAM_DRAW);
+        glBufferData(GL_ARRAY_BUFFER, vbo_max_size, NULL, GL_STREAM_DRAW);
     }
 
     // Copy and convert all vertices into a single contiguous buffer