[Solved]Project Structure Help
Posted: Tue Mar 16, 2010 2:42 pm
Hi everyone,
I'm writing in hope of some much appreciated guidance as I feel the way in which I structure my C++ projects/games isn't always the best.
Currently I aim to have as few lines of code as possible in main, just the main loop (I used to have it all dumped in one 'main' file ), now I include separate .cpp and headers. However the way in which I have separated my files seems... disorganized. I usually have one big .cpp and .h with all my classes in and one file containing all my structures. I also try to split relevant code into separate files (ie, a file for 'input' functions, a file for 'TextBox' functions) but this sometimes causes compiler errors which I usually get around with by adding a header file full of includes ect. (Not the best way I feel). I'm sure I'm missing a trick here and I'm hoping to improve. Should I really have a separate 'input' file or include it within a 'player class' which actually utilizes the input, I'm hoping this makes sense. So what code structures do you implement within your projects, if any?
Thanks in advance!
I'm writing in hope of some much appreciated guidance as I feel the way in which I structure my C++ projects/games isn't always the best.
Currently I aim to have as few lines of code as possible in main, just the main loop (I used to have it all dumped in one 'main' file ), now I include separate .cpp and headers. However the way in which I have separated my files seems... disorganized. I usually have one big .cpp and .h with all my classes in and one file containing all my structures. I also try to split relevant code into separate files (ie, a file for 'input' functions, a file for 'TextBox' functions) but this sometimes causes compiler errors which I usually get around with by adding a header file full of includes ect. (Not the best way I feel). I'm sure I'm missing a trick here and I'm hoping to improve. Should I really have a separate 'input' file or include it within a 'player class' which actually utilizes the input, I'm hoping this makes sense. So what code structures do you implement within your projects, if any?
Thanks in advance!