Archived

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

use STL instead of node in the OGL programming book engine

This topic is 5787 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I would like to modify the object managment of the OpenGL programming Book's engine (A time to Kill). I would like to know what you think about to manage it with vector. Actually, all object class, terrain and player are derived from a class : CNode, which has a parent, child and brothers. For exemple, child of the terrain are all objects which are on this one, etc... When we want to render a frame, we go forward over all the linked list and call the Draw() function for each one. Do you think it will be really slower to use a container like a vector ? (i.e : terrain has a vector of all the object which are on this one) Edited by - bestel on January 30, 2002 2:45:53 AM

Share this post


Link to post
Share on other sites
Yeah I've done exactly the same thing. It seems nicer to me but the real question is having a set of stl linked lists more efficient than the sibling pointers presented in the ogl game dev book. I would tend to think that the pointers are more efficient although conceptually i prefer the other solution, but how much more efficient would this be ? is it worth sacrificing that little bit of mem/cpu for a simpler more comprehensive implementation ?

Edit - What I mean by efficiency is having the whole stl linked list system linked as opposed to two little pointers which aren't particularly problematic to manage..

cheers

Tony

Edited by - TonyFish on February 13, 2002 10:00:13 AM

Share this post


Link to post
Share on other sites