Jump to content
  • Advertisement

Archived

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

Moe

Am I going about this the wrong way? (program structure)

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

I have been trying to write a decent sized program for some time now (I''m not trying to make my program big purposely, its just becoming big with all the code that I need). Right now I am using one large class (that I call ENGINE) and few globals (such as my timing class and my logfile class). I need the timing global and the logfile global because I need access to them in all parts of my program (I will need to log errors from all the parts of my program. The timing is global so that I don''t have to pass a pile of parameters to every function that needs access to the timing code). Now the basic classes each have thier own header file (for the class declaration) and a cpp file for the actual function code. It just seems that my program isn''t structured properly. I can''t really put my finger on it, it just doesn''t seem right. I have taken a look at a singleton class design, but I don''t really like that idea. How is it that very large programs/projects are structured? (By large I mean something like quake or any other commercial game out there.) Moe''s site

Share this post


Link to post
Share on other sites
Advertisement
That''s similar to the way I do it, although I don''t like using classes for things that are only instantiated once (like your engine, for instance... Whoops, bad pun)

Share this post


Link to post
Share on other sites
So how big of a project can be done this way before things get too messy? For some reason I always think my code design is ugly and end up re-writing it once every few months.

Moe''s site

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!