PDA

View Full Version : Fastest way to store objects



Wolfling
03-14-2001, 12:58 PM
I'd like to have you opinions about the fastest way to store objects in memory. I currently use linked lists for primitives of equal type, eg quads using texture[0], what works acceptably fast even though I have to save a lot of information about every type. There is but a small possibility that I still didn't find the perfect way http://www.opengl.org/discussion_boards/ubb/smile.gif so do you have any suggestions?

chennes
03-14-2001, 01:08 PM
I use arrays - less memory, and it's handy sometimes to know that it's contiguous - you can use pointer arithmetic to access it if you're going linearly.

Chris

Arath
03-15-2001, 02:10 AM
You should use array for vertices, faces and texture coordinate, since it's faster than linked list and you'll be able to use Vertex Array (via glVertexPointer and so on) instead of glBegin, that will speed up the whole drawing function.

Arath

Wolfling
03-15-2001, 01:35 PM
Well I do use arrays, but only partially. As I mentioned above I have a structure that stores the type of drawing to do, the texture to use and arrays for vertices and faces, and has a pointer to the next structure for primitives using different texture or shape. What I actually meant is, if there Is a better way to do that.