allocate memory for the buffer before using it
This commit is contained in:
parent
1cbc9336fe
commit
8a36fe10b1
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user