Vertex array question

Started by
0 comments, last by Qoy 22 years, 8 months ago
I'm writing a little framework to experiment with OGL functions, and I'm thinking about writing some kind of basic object type that would basically just hold vertex arrays, normal arrays, and texcoord arrays, along with a position representing the modelspace origin. Because everything I draw might not be using all the same types of arrays, and each object will have its own arrays, I figure before I need to draw an object I'll have to call a function with it to set the appropriate array pointers. The obvious solution is to have a function that enables and sets a pointer for each array that the object uses, and then a function for after drawing the object that disables the arrays, so they won't be polluted if the next object doesn't use the same types. However, I'm not that experienced with OGL yet, and so I don't have a good feel for what is slow and what is not. It is a bad idea in terms of performance to enable and disable the arrays before and after each object is drawn? Thanks! Edited by - Qoy on July 31, 2001 4:35:47 PM
Advertisement
good idea what i do though is only set the arrays before you draw
ie
if (do i need colour array)
{
is ( colour arrays NOT enabled )
enable colour array
}
else
{
is (colour arrays enabled )
disable colour array
}

This topic is closed to new replies.

Advertisement