Jump to content
  • Advertisement

Archived

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

no one

game flow... question

This topic is 5384 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

Hello First off, let me say that I did not post this in the game programming forum because I feel this is more of a general issue then game related. I have made a system for how my game handles world entities but im not sure if its the best I could use. Basicly, all derived entity classes of CEntity have functions for loading sub classes, such as void AddMesh(char*type,pos,rot) this function then creates a new instance of the type specified if(type == "player") temp = new CPlayer()... then this new instance is stored in a stl list. A class called CEntityManager then does operations for this global list such as delete all, draw all, update all etc. These functions are then called in the apps main loop. Is that the best way I could handel a oop base system?

Share this post


Link to post
Share on other sites
Advertisement
Yes.. you can put the update function in the game-loop, but you can also put different update routines in different threads.


also, try not to compare char* pStr with if(pStr == "bla"), use strcmp()==NULL instead

----------------------------------------------
Petter Nordlander

"There are only 10 kinds of people in the world. The who understand binary and those who don''t"

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!