Fix VBO data type

GL_DYNAMIC_DRAW == update occasionally
GL_STREAM_DRAW == update on every draw
pull/3/head
Hleb Valoshka 2019-12-12 22:54:23 +03:00
parent ad2de6b6a5
commit 705c383b9f
2 changed files with 2 additions and 2 deletions

View File

@ -6638,7 +6638,7 @@ static void drawRectangle(const Renderer &renderer, const Rect &r)
array<float, 8> vertices = { r.x, r.y, r.x+r.w, r.y, r.x+r.w, r.y+r.h, r.x, r.y+r.h };
auto s = static_cast<GLsizeiptr>(memsize(vertices) + memsize(texels) + 4*4*sizeof(GLfloat));
static celgl::VertexObject vo{ GL_ARRAY_BUFFER, s, GL_DYNAMIC_DRAW };
static celgl::VertexObject vo{ GL_ARRAY_BUFFER, s, GL_STREAM_DRAW };
vo.bindWritable();
if (!vo.initialized())

View File

@ -92,7 +92,7 @@ renderTerminator(Renderer* renderer, const vector<Vector3f>& pos, const Vector4f
* Because of this we make calculations on a CPU and stream results to GPU.
*/
static celgl::VertexObject vo{ GL_ARRAY_BUFFER, maxSections * sizeof(Vector3f), GL_DYNAMIC_DRAW };
static celgl::VertexObject vo{ GL_ARRAY_BUFFER, maxSections * sizeof(Vector3f), GL_STREAM_DRAW };
auto *prog = renderer->getShaderManager().getShader("uniform_color");
if (prog == nullptr)