Sign in to follow this  

Managing Objects and Resources

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

How can I manage the objects and resources (images, sounds, etc) in my game? Right now I just create/load them when the states change, but that seems hard to manage.

Share this post


Link to post
Share on other sites
I mean make sure they get created and deleted properly. I mean change from the introduction state (load screens, show them, delete them), then to the menu state (create menu buttons, check user input), and so on.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kenny77
I mean make sure they get created and deleted properly.

What makes you think they might not be?

Quote:
I mean change from the introduction state (load screens, show them, delete them), then to the menu state (create menu buttons, check user input), and so on.

You said in your first post that this is what you already do.

I think you will have to be more precise about the problem - knowing which language you're working in helps too.

Share this post


Link to post
Share on other sites
What I do, is I create a Manager class for specific resources I want to manage. For example, I have a Texture Manager which I can use to load in texture files. If I try to load in the same texture multiple times, then the manager knows not to load in the same texture again. The manager cleans up all the memory too once my program is finished.

The storage of all my memory usually goes into a std::vector or some other similar container.

Share this post


Link to post
Share on other sites

This topic is 3462 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this