moved gl calls out of the loop

No need to call glVertexAttribPointer with bind/unbind inside the rendering loop