OpenGL VAO VBO EBO explained

i recently answered a that in another topic

more detailed information can be found here:
https://www.opengl.org/wiki/Vertex_Specification_Best_Practices

in short:
use 1 vertex array for 1 vertex layout
use 1 buffer for all vertex attributes, or 1 for each attribute
if you need a buffer for dynamic data (e.g. a dynamically changing model), use 1 buffer for all the dynamic mesh data
consider double buffering + transform feedback if you have dynamically changing mesh data

[QUOTE=gremlin;1284303]To keep things simple, i need to make some kind of Batcher-like(?) class, that will be manage those types of buffers, and have some methods to load and handle textures and draw final sprites geometry, so i can draw it with single call: Batcher.DrawSprite(texture, x, y, angle, scale, color);

Is that a good way for a simple 2d scene?[/QUOTE]

for a simple 2D renderer (with static meshes), you first create the mesh data and put everything into 1 buffer

struct DrawCall {
unsigned int Primitive, VertexOffset, VertexCount;
} triangle, quad, star, youknowwhat, …;

std::vector<Vertex> vertices;
// create triangle vertices and set the drawcall data:
triangle.primitive = GL_TRIANGLES;
triangle.VertexOffset = vertices.size();
vertices.pushback(Vertex(0, 0));
vertices.pushback(Vertex(1, 0));
vertices.pushback(Vertex(0, 1));
triangle.VertexCount = vertices.size() - triangle.VertexOffset;
// do the same for quad / star / youknowwhat…
// when done, put all the data into 1 big buffer

if you want to draw everything, call
glUseProgram(myShader);
glBindVertexArray(myVAO);

for (…alltriangles…)
// set uniform data here
glDrawArrays(triangle.primitive, triangle.VertexOffset, triangle.VertexCount);

ask yourself the question:
– why should a triangle have its own buffer instead of sharing it with the quad ?
– has the triangle and the quad the same vertex attributes ? if yes, sharing the same vertex array / program / shaders is a good idea