Archived

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

Vendayan

Managing worldspace storage

Recommended Posts

I was just wondering if anyone could tell me how to store an array of objects that would make up a worldspace without using too much memory, someone suggested that I use a temporary array, and create a new one every time I need to expand it for another object, but i doubt that this is the best method. So what would be the best way to go about it? I''m assuming my objects will be made of a pointer to a texture and a vertex buffer, but how do I manage the array? ~Vendayan

Share this post


Link to post
Share on other sites
The stl vector does essentially what you just described. Using a list (whether stl or a simple linked list) is an alternative. If you need to access any element of the list/array at any time, and/or you have a static world, then the array/vector approach would work better. If you will be iterating through the list from one entry to the next to the next, then the list approach would make more sense, especially if you have a very dynamic world.

Share this post


Link to post
Share on other sites