PDA

View Full Version : passing vertices and indices to opengl



Siddy1
01-21-2015, 06:00 AM
Hi. I'm kinda new to OpenGL and I was wondering how I can draw cube indices from a vector instead of an array. I've already written a Wavefront obj loader, now I just need to pass the vertices, normals, etc. to OpenGL. If anyone could help me out that would be appreciated, thanks! :D

Dark Photon
01-21-2015, 06:33 AM
I was wondering how I can draw cube indices from a vector instead of an array.
What do you mean vector and array? Are you talking about a std::vector instead of a C/C++ array? If so, then just pass the address of the first element of the vector. Just like a C/C++ array, all the storage is contiguous in a vector so that works.

Siddy1
01-21-2015, 08:13 AM
Yes, I meant std:vector, and Thanks for the help! :)