Login  Register

Re: How to change the color of the cylinder when double clicked it

Posted by elect on Mar 21, 2016; 8:04am
URL: https://forum.jogamp.org/How-to-change-the-color-of-the-cylinder-when-double-clicked-it-tp4036489p4036525.html

In the init, after we generated one VAO, we have to set it up. This means we have to set the vertex layout (through glVertexAttribPointer) and the element/index buffer object (IBO) if we render indexed geometry. That is, while the VAO is bound we bind the corresponding IBO.

In the rendering then, we don't have to set up again any vertex layout or bind again the IBO, we will just need to bind the VAO, like here, and it will automatically restore all the parameters we set inside it.