question on textures and vertex arrays

I’m somewhat confused on how to put textures and vertex arrays together. I thought that once you put all the data you want to draw into vertex arrays you’re done - you just call glDrawArrays on the entire array and everything is rendered. But certain polygons in my code use different textures. Is there a way to specify which texture should be used for which vertices beforehand, or do I have to to it ‘manually’, which is: bind texture, draw a sub-range of vertices, repeat ? I would appreciate if someone could share his/her experience on this one.


With plain ogl vertex arrays, there’s no way to change the texture inside a vertex array, so yes, you have to split it manually.

I don’t know whether there’s an extension to address this issue.

I don’t think there is any extension available.

Which would be quicker? Creating separate vertex arrays, one for each texture and using DrawArrays, or one vertex array using DrawElements to draw sub-sections of it?

Most probably the second option, especially with CVAs, since it’s generally a good idea to minimize the number of gl calls.