Advertisement Jump to content
Sign in to follow this  

C++ coding outside classes (seek anyhowl opinion)

This topic is 4880 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
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!