View Full Version : Fastest way to store objects
03-14-2001, 11:58 AM
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, 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?
03-14-2001, 12: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.
03-15-2001, 01: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.
03-15-2001, 12: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.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.