0

i am writing a class for making easier the Vertex Array Object, i want to generate Vertex Array Objects in X number and store them in a std::vector.

How i can do that? I do not want to this in a loop, this is will be faster.

glGenVertexArrays(VAONumber, myVector); 

1 Answer 1

4

The std::vector class emulates an array, which means all its data is allocated in a contiguous chunk of memory, just like an array. That means you can get the whole array if you have a pointer to the very first element, i.e. &myVector[0].

There's also a utility member function data to get this pointer.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.