Note that there are some explanatory texts on larger screens.

plurals
  1. POOutOfMemoryError issue in Vertex buffer Object (VBO)
    text
    copied!<p>I'm facing problem here when moving from VAO to VBO for rendering. I'm using Android platform and using OpenGL API from JNI. Here is my snippet code</p> <pre><code>// Initialize in constructor GLuint buffer[3]; glGenBuffers(3, buffer); // In onDrawFrame(), I create draw function. // My object data will be dynamically updated during runtime so I used GL_DYNAMIC_DRAW. glBindBuffer(GL_ARRAY_BUFFER, buffer[0]); glBufferData(GL_ARRAY_BUFFER, genData.cubeNumVerts * 4, genData.vertex, GL_DYNAMIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, buffer[1]); glBufferData(GL_ARRAY_BUFFER, genData.cubeColorVerts *4, genData.colors, GL_DYNAMIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, buffer[2]); glBufferData(GL_ARRAY_BUFFER, genData.cubeNormalVerts * 4, genData.normals, GL_DYNAMIC_DRAW); if(genData.vertex == 0 || genData.normals == 0 || genData.colors == 0) LOG("Error: failed to allocate a memory"); glBindBuffer(GL_ARRAY_BUFFER, buffer[0]); glEnableVertexAttribArray(vertexHandle); glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0,0); glBindBuffer(GL_ARRAY_BUFFER, buffer[2]); glEnableVertexAttribArray(normalHandle); glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0,0); glBindBuffer(GL_ARRAY_BUFFER, buffer[1]); glEnableVertexAttribArray(mColorHandle); glVertexAttribPointer(mColorHandle, 4, GL_FLOAT, GL_FALSE, 0,0); glDrawArrays(GL_TRIANGLES, 0, genData.cubeNumVerts); glDeleteBuffers(3, buffer); </code></pre> <p>by using this snippet code, I got OutofMemoryError when rendering. I could not figure out what might cause this error. if anyone notice the inapproriate of using VBO from this snippet code please help me.</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload