Jump to content
  • Advertisement
Sign in to follow this  
akinkhoo

C++ coding outside classes (seek anyhowl opinion)

This topic is 4818 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 decided to clean up my earliest RTS engine today. when i wrote the codes, it was in a very isolated and noob way; the entire GUI subsystem is operated (rendering, event handling, rescaling, draw order, memory cleanup etc) by a managing class 'guimain.cpp' just so to keep the 'main.cpp' neat. i create the only instant of this class in the 'main.cpp', but it doesn't make alot of sense since i am likely to use only 1 copy of this. so what do i do with this 240 lines class now? should i just pack it out and use it like a include? is there a correct way of keeping things nice and clean? or should i leave it as is... some background on use: this class is access by 'gamestate.cpp' which load the different menus mode to the gui. orginally i plan for 'gamestate.cpp' to load seperate GUI, but then i discover my implementation could "hide" entire node within 1 instant so there was no need to create more gui which would need to refresh the display when reloaded. what a design mix up i had back then creating more work then needed!! :(

Share this post


Link to post
Share on other sites
Advertisement
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!