allocate memory for the buffer before using it

This commit is contained in:
Anakin 2016-11-05 13:36:28 +01:00
parent 1cbc9336fe
commit 8a36fe10b1
1 changed files with 4 additions and 1 deletions

View File

@ -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
{