How to use Vertex Array Objects with OpenGL
If you are confused about Vertex Array Objects or have forgotten how to use them, you are in the right place. In this post I will explain all the code needed to load and render a simple mesh using Vertex Array Object (or VAO for short). First you have to be aware that VAOs is an abstraction, meaning that it encapsulate a functionality to ease development with the OpenGL API. In this case it contains a series of OpenGL buffers configured in such a way to provide the GPU with all the necessary vertex data to render a 3D model. For completeness I have to mention that this feature is available since OpenGL version 3.0 and it is much faster than previous alternatives like glBegin() and glEnd(). To create a VAO, you have to use the function glGenVertexArrays(GLsize n,GLuint *Arrays), where "n" is the amount of VAOs to create and "Arrays" is an array of integers to store the objects. Like most objects in Opengl, VAOs are represented as integers and have to be "bou