From e16c6af04a67efc2768ea6f49636348a38ed039f Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sun, 11 May 2014 02:24:17 +0200 Subject: [PATCH] Forget a sizeof(float). --- src/graphics/render.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/graphics/render.cpp b/src/graphics/render.cpp index 4b42bd5a9..43fab1831 100644 --- a/src/graphics/render.cpp +++ b/src/graphics/render.cpp @@ -216,16 +216,14 @@ void IrrDriver::renderGLSL(float dt) for (it = lines.begin(); it != lines.end(); it++) { UtilShader::ColoredLine::setUniforms(it->first); - for (int i = 0; i < it->second.size(); i += 6 * 1024) + const std::vector &vertex = it->second; + const float *tmp = vertex.data(); + for (int i = 0; i < vertex.size(); i += 1024 * 6) { - unsigned count = MIN2(it->second.size() - i, 6 * 1024); - glBufferSubData(GL_ARRAY_BUFFER, 0, count, &(it->second.data()[i])); + unsigned count = MIN2(vertex.size() - i, 1024 * 6); + glBufferSubData(GL_ARRAY_BUFFER, 0, count * sizeof(float), &tmp[i]); glDrawArrays(GL_LINES, 0, count / 3); - -/* draw3DLine(core::vector3df(it->second[i], it->second[i + 1], it->second[i + 2]), - core::vector3df(it->second[i + 3], it->second[i + 4], it->second[i + 5]), - it->first);*/ } } glUseProgram(0);