This is a tutorial which tells you how to use the ChronoEngineWizard
in order to create a C++ project which uses the Chrono::Engine library.
This represents the fastest way to start using the Chrono::Engine
library.
Note that these instrunctions apply only to users of Microsoft Visual C++
(from v.8), because we will use the new 'wizard' which has been added to
the Visual C++ IDE when you installed the Chrono::Engine SDK.
Follow the following steps.
1.c - Start the IDE
First of all, start the Microsoft Visual C++ IDE (version 8 or
superior is required, as in the 'VC++ 2005 Express' edition), and
go to the menu File / New / Project ..
as in figure:
2.c - Start the ChronoEngineWizard
In the 'New Project' window, select the Visual C++ root, so you can
see all types of available wizards. If the installation of Chrono::Engine has
been successfully, you should see a custom wizard called ChronoEngineWizard, as in the fiure below.
Select that wizard and enter a directory in 'Location' and a name in the 'Name' field, then press the 'OK' button.
3.c - Wizard settings
Now you should see the window with the settings for the wizard:
(Note that, if things went ok during the installation of Chrono::Engine, these
settings should already contain the correct paths of the
directories of your Chrono::Engine SDK and your Irrlich SDK, so you should
simply press the Finish button. Otherwise just press the '...' buttons and
browse to the directory where you installed the SDK.)
Note: in case you uncheck the 'Use Irrlicht' button, a template project
will be created anyway, but it will not use 3D visualization (it will be a
very simple console program, with text output).
After you checked that the directories are correct, press the Finish button.
THAT'S ALL! The project will be created in the location directory you specified!
4.c - Open the project
Now, to open the project, go to the directory where you created the
project, on your disk.
Now double click on the '.sln' file (the Visual C++ 'solution'), so your
Visual C++ IDE will open the contents of the project. Note that the
Solution Explorer window (at the left of the screen) will show the template
files contained in your project, for example try to double-click on the
main.cpp source file, as in the picture below:
5.c - Set debugger directory
Now there is an optional, but strongly suggested step.
Use menu 'Project / Properties..', then select 'Configuration: All configurations',
then go to the 'Debugging' section and enter $(OutDir) in the
'Working Directory' field; as in the figure below:
(This is necessary because, in this way, the current directory of the
program, when launched by the debugger, will be the same where the
.exe file is - this will avoid problems if the program must access
relative paths).
6.c - Compile
To compile and execute the program, click on the green arrow on the
toolbar (as in the picture below) or press F5.
Aftr few seconds of compilation, you should see the simulation
of a pendulum with a spring:
THAT'S ALL!
NOTES
Where is the .exe ??? Usually, the Visual C++ IDE puts the compiled .exe executable
into the Debug\ or Release\ subdirectories of the project: this is NOT the case when
using the projects generated by the ChronoEngineWizard!
In fact, projects generated by the ChronoEngineWizard are configured to put the .exe
file into your ChronoEngine\bin\Win32_VisualStudio\ directory, together with all other
Chrono::Engine demos.
There is a reason for this: some programs based on Irrlicht will need to load textures
and skybox maps, which are saved in the directory ChronoEngine\bin\data, so this choice is more
efficient in terms of resources (anyway, you can still modify the output directory of the
project, if you don't like this setting).
What happens if you choose not to use Irrlicht, in the wizard setting window? There
are no problems: a simple console application is created as a template; of course you
won't see the 3D simulation of the pendulum as in the picture above, you will just
see some basic text output.
You can use the wizard-created project to compile also the demos: simply delete the
template main.cpp and add one demo source file into the project (menu Project / Add Existing Item..),
for example demo_collision.cpp, then compile.