Tech/LxEngine/Getting Started on Windows with Visual Studio 2010

LxEngine requires several tools and external in order to built properly. An effort has been made to automatically handle as many of the dependencies as possible, however the initial setup nevertheless still requires numerous downloads and a time-consuming first compilation. Please provide feedback on the forums if you have suggestions on improving the process.

Install the Required Software

 * Download Visual Studio 2010 Express (if necessary)
 * Download Cygwin or msysgit (needed for using "git" for version control)
 * Download CMake 2.8 or higher (necessary for setting up the build)
 * Download Python 2.7 (required to build Google V8)
 * Download SCons 2.0.1 (required to build Google V8)
 * Download Microsoft DirectX SDK (required to build OGRE)

Visual Studio 2010
Visual Studio 2010 is required as C++0x features not available in prior versions are used by LxEngine. Note: the Professional editions of Visual Studio 2010 should also work equally well. Other compilers may be supported in the future (especially gcc), but currently VS2010 is the only supported compiler.

Cygwin or msysgit
Cygwin and msysgit both provide a Unix-like command prompts that provides a reliable version of git for version control. Cygwin provides far more services than simply git, but LxEngine requires Cygwin only for git functionality; thus, msysgit may be a preferred choice as it provides solely git functionality without many other services. There are other Windows git implementations, however Cygwin and msysgit are the recommended implementations as they provide an identical interface as with Linux builds allowing for one set of instructions to work in all environments.

More information: Note when running the Cygwin if "git" is not a recognized command, simply run setup.exe again, search for "git", and install it to update the cygwin environment.
 * MSysGit wiki page
 * Cygwin home page

CMake
CMake is a cross-platform, "make"-like tool that generates build files for a host of different compilers. This allows a single build configuration file to be maintained that will work correctly with multiple compilers (as opposed to maintaining a separate set of Makefiles, Visual Studio project files, etc.). The syntax of CMake may be a bit unfamiliar at first and documentation is often difficult to track down, but ultimately it is a useful tool that is relatively straightforward to use.

More information:
 * CMake home page

Python 2.7 and SCons
SCons is a build tool (similar to CMake) that is required to build the Google V8 JavaScript Engine, a external component used by LxEngine to support Javascript. SCons in turn is written in Python and requires Python to be installed. Python 2.7 and SCons 2.0.1 are recommended as these versions have been tested with LxEngine. Neither SCons nor Python are directly required by LxEngine, but are required to properly build V8. Users of LxEngine do not need to know SCons or Python, as these are invoked only by build scripts and should not require direct modification.

Clone the git respository
First, in a web browser...
 * Create a github account
 * Fork the 'official' repository by clicking the Fork button on http://github.com/athile/lxengine

Then, in a cygwin bash shell or msys git bash window...
 * Clone your remote repository via the private read+write URL:
 * Add the official branch to your local repository:
 * Change directory to for the next command
 * Update the submodules in the repository:

Alternately, you can download the latest lxengine source via a zip file on github; however, you will also need to download the latest GLGeom zip file and extract it to.

Run the Dependencies Script
If you are using Visual Studio 2010, there is a batch file that handles downloading and building of all LxEngine dependencies. It is intended to "just work": download, build, move the built files to a standard location that LxEngine's configuration knows about, and exit.



Note: the batch file must download all dependencies and build them. This can take as the dependencies include large, complex projects, so please be patient. It is only necessary to build the dependencies once, however, so this is a one time cost to the initial setup of LxEngine.

This batch file is in alpha development and has not seen much real-world testing on different configurations. Please contact us for support issues so that we can improve this batch file to make sure it really does "just work".

First Build
The source code is located in the directory. The code is intended to be built from the directory (this is called an out of source build).



The is a simple batch file that will set up the Visual Studio command-line tools and will call CMake and print added information to the user. Experienced users can should examine the batch file to see specifically what it does (which is not much).

The gen_vs10.bat file will generate a Visual Studio 2010 solution file. This can be opened in the IDE and built, or built directly from the command-line via the command. The and batch files are convenience files that simply invoke  with the correct parameters for each build type.

Testing the Build
Assuming has succeeded, try running some unit tests and samples. All the executables expect to be launched from the "build" directory in order to locate their resource files.


 * Try . 100% of the tests should succeed
 * Try

What's Next?
Possibly:
 * Search the LxEngine web site for more samples to try
 * Try the tutorials on the web site
 * Modify one of the samples as a starting point for your own project
 * Contribute to the engine itself by adding new core code, bug fixes, samples, unit tests, benchmarks, etc.
 * Post of the forums on about the project you're going to undertake with LxEngine for suggestions and help