TheCherno / Hazel

Hazel Engine
Apache License 2.0
11.76k stars 1.51k forks source link

Why does a VertexArray use a vector<> to store the reference of a VertexBuffer, even though there is only one throughout its entire lifetime? #651

Open thePZH opened 1 year ago

thePZH commented 1 year ago

std::vector<Ref<VertexBuffer>> m_VertexBuffers;

I don't know if I missed anything? perhaps this container might increase to more than 2 at some point , or in the future?

I'm a newbie, please don't laugh at me : )

Ggjorven commented 8 months ago

I think it's because a VertexArray in OpenGL can hold on to multiple vertexbuffers. Even though in this engine it is not used it is nice to have the option to do that. And makes it easier to scale the engine.

Just to clarify, I do not work on this project. This is just what I think.