Archived

This topic is now archived and is closed to further replies.

OrangyTang

Wrapping vertex arrays

Recommended Posts

How do you people go about wrapping vertex arrays up in some convinient form and/or class? At the moment i have a large amount of dynamic geometry rebuilt every frame which I want to use vertex arrays instead of immediate mode. Since the apps format is unsuitable to be bunged straight into a set of arrays, I was thinking of creating some sort of wrapper class to manage the colour/texcoord/vertex set of arrays, as well as the indices array. Then the data could be pushed to this object as it is generated, and once full the client state and glDrawElements could be called via some sort of .flush method in the wrapper object. Is this a suitable idea or do people typically wrap this kind of thing in other ways? My main problem is that i''ve got lots of little objects (currently fans and strips) which i want to batch together into one glDrawElements. Suggestions?

Share this post


Link to post
Share on other sites