Jump to content
  • Advertisement
Sign in to follow this  
mauzi_the_Dude

[.net] C# game - using the singleton pattern for the gameengine

This topic is 5006 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´m currently designing a little gameengine in c# and managed directx. thinking about the core of the game (containing the timer, physicsclacs, gamelogic and input processing) i wan´t to use the singleton pattern so i can access i. ex. the timer for my splashscreens or the gametime. i how far would this pattern slow down my performance or disadvantages would it bring along, because i´ve never seen it in any examplegames or tutorials ... ? thnx the Dude [Edited by - mauzi_the_Dude on March 4, 2005 12:16:35 AM]

Share this post


Link to post
Share on other sites
Advertisement
Hi Mauzi!

The singleton pattern doesn't slow down anything - it may give you a little perfomance boost because you don't have to send your timer etc. in other functions every frame or at startup.


You can use the pattern if:
.) You just want to do it fast and get it working.


But you don't have to use it if you design your system in a way that everything "plays" its own roll. But that is not that easy and you will have to learn alot till you can. ( I myself too! )

If this is one of your first engines then I would say GoForIt! and use the singleton- pattern. You don't want to make Source2- do you? :)

Bye,
Riddle.

Share this post


Link to post
Share on other sites
not really, i'm please when i get the whole thing working alright.
thnx for the motivation then i'll go for it ;)

i'll keep you update with the progress

greetz the Dude

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!