Page 1 of 1

Question for IOS Support post

PostPosted: Sat Mar 17, 2012 3:25 pm
by codeslasher
My engine is organized into mini-engines, which are each their own projects (brought together into one master project) and build into separate libraries. The sound library, terrain library, physics library, etc. This keeps things highly modularized and ensures a logical connection between components. It would be similar to keeping each library in its own folder inside as part of the master project, except that it forcibly ensures that libraries can’t lazily #include files from outside their designated scope simply by adding another ../ to the #include path. It also makes it very clear how each library related to the other libraries.

Hi lspiro, could you please explain this some more with examples? Especially the part about preventing lazy includes.
In my projects,I've used seperate projects for maths,primitives etc but still have to do -
#include "../Maths/Vector.h"
from other parts of the engine.
How are you handling this kind of connection between the projects.

Re: Question for IOS Support post

PostPosted: Fri Mar 30, 2012 5:20 am
by L. Spiro
I am a little late. Sorry.
This image probably explains it fully.
Image


For any given module, set the header search paths to include the paths to the code from the other modules, then include in the form of:
Code: Select all
#include "Vector/LSMVector3.h"

This way people can’t make an include that should not be done, such as trying to include the engine from the math library.
Instead they will have to rethink their design and come up with a correct solution.


L. Spiro

Re: Question for IOS Support post

PostPosted: Fri Apr 06, 2012 11:11 pm
by codeslasher
Thanks for the information, will try it out soon.