Commit 8a36fe10 authored by Anakin's avatar Anakin

allocate memory for the buffer before using it

parent 1cbc9336
......@@ -11,7 +11,7 @@
#define VERTEX_SHADER "Shader/TextureShader.vert"
#define FRAGMENT_SHADER "Shader/TextureShader.frag"
#define MAX_MODEL_COUNT 1000
/////////////////////////////////////////////////////////////////////////
// public constructor/destructor
......@@ -113,6 +113,9 @@ void OpenGLController::processInit()
glVertexAttribDivisor(4, 1);
glVertexAttribDivisor(5, 1);
// set buffer size
glBufferData(GL_ARRAY_BUFFER, MAX_MODEL_COUNT * sizeof(glm::mat4), NULL, GL_STREAM_DRAW);
// get the painter ready
try
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment