# README.msvc.txt - 2010-04-16

Compiling Atlas Source in native Windows, using
MSVC9 Express (2008)

All projects, Atlas, Map, and win_util.lib are compiled using the
Multi-threads (DLL) runtime, /MD, as are ALL the dependants.
Getting this wrong causes lots of hassles.

There is a general, had crafted project/msvc/config.h file,
where you can adjust the version, and perhaps the default
location of the FlightGear data, set as C:\FG\32\data in
my case.

Directory Arrangement:
---------------------

Choose a folder for the Atlas source. I chose 'Atlas',
and I put most of the dependencies in the root of
Atlas. That is :-
<some root>\Atlas - Full source of Atlas/Map
           \simgear
           \PLIB
           \zlib-1.2.3
           \boost-trunk
           \lpng
           \etc
although some are compiled in my C:\Projects folder,
such as :-
C:\Projects\jpeg-4a
           \glew-1.5.3

Dependencies:
------------

Essentially, Atlas is sort of part of the FlightGear project,
so once you have compiled FlightGear, you will have most of
the following dependencies already.

FlightGear - binary, and at least the base 'data'

Simgear - Simulator Construction Tools 
site: http://www.simgear.org/
I used the CVS version, downloaded, and compiled as part of FlightGear

PLIB - STEVE'S PORTABLE GAME LIBRARY
site: http://plib.sourceforge.net/index.html
I used the CVS version, downloaded, and compiled as part of FlightGear

GLUT - freeglut, OpenSource alternative to the OpenGL Utility Toolkit (GLUT) library
site: http://freeglut.sourceforge.net/
I used the SVN version, downloaded, and compiled as part of FlightGear

zlib - A Massively Spiffy Yet Delicately Unobtrusive Compression Library
site: http://www.zlib.net/
I used Version 1.2.3 (July 2005), although I note there is now a 1.2.4.
Downloaded: 08/20/2009  19:26 496,597 zlib-1.2.3.tar.gz
and compiled as part of FlightGear

OpenSceneGraph - open source high performance 3D graphics toolkit
site: http://www.openscenegraph.org/projects/osg
I used a relatively recent SVN version, compiled as part of FlightGear

libpng - Portable Network Graphics
site: http://www.libpng.org/
I used version lpng1232.zip, but note there is now a 1.4.1 (lpng141.zip)
Compiled as part of building OSG for FlightGear

Boost - portable C++ source libraries
site: http://www.boost.org/
I alternate between using the SVN trunk, and version 1.39.0
ONLY the boost headers are required - no compiling.

Jpeg - Independent JPEG Group (IJG)
site: http://www.ijg.org/
Download and compile: 04/16/2010 11:14 1,037,823 jpegsr8a.zip, or later
I compile the libraries as jpeg32.lib and jpeg32d.lib

OpenGL Extensions - a choice- I chose (b)

(a) OpenLibraries - key building blocks ... to build rich media applications
site: http://sourceforge.net/projects/openlibraries/
Download and install: 04/16/2010  12:49 6,214,295 openlibraries-0.4.0-sdk.exe, or later...
This adds two environment variable, like :-
OPENLIBRARIES_INCLUDE_PATH=C:\Program Files\OpenLibraries\include\openlibraries-0.4.0
OPENLIBRARIES_LIB_PATH=C:\Program Files\OpenLibraries\lib
But could not find the *.lib to link with... so gave this up...

Or MAYBE just
(b) GLew - The OpenGL Extension Wrangler Library
site: http://glew.sourceforge.net/
Download, unzip, and compile: 04/16/2010 13:25 642,576 glew-1.5.3.zip, or later...
Then include <GL/glew.h>, using a GLEW_STATIC macro, and link with glew.lib...
So I used this 'static' library, rather than the DLL approach of (a).

Compiling:
----------

The folder 'projects/msvc' contains two types of MSVC build files,
and various other needed items. For backward compatibility, these
is an Atlas.dsw, which can be loaded, and converted by any version
of MSVC, and a 'solution', Atlas.sln, for MSVC9 (2008).

Loading one of these build file sets in your MSVC, and build.
Naturally, if you have dependencies in different folder to those
in the build file set, then these will need to be adjusted.

The <project> Property Pages -> C/C++ -> General -> Additional
Include Directories (AID) _MUST_ be set right. Likewise for the
Linker -> General -> Additional Library Directories (ALD) must match
the library list in -> Input -> Additional Dependencies (AD)! And
these can vary between Debug and Release builds.

And REMEMBER to _ALWAYS_ carefully check the RUNTIME being used,
both for Atlas, Map, and _ALL_ the dependant components. I chose
Multi-threads (DLL) runtime, /MD, and /MDd for Debug. As stated,
using inconsistent runtimes causes lots of PAIN ;=().

Running:
--------

1: Map: This need to be run first, to generate the MAPS to be used
by Atlas. The 'default' location is <FG_ROOT>\Atlas. Run
map.exe --help to see the input options...

This will scan the <FG_ROOT>\Scenery, and build 'map' for the
San Francisco area, and any other areas you have downloaded
and installed. These will be output into a series of folders
call 10, 9, 8, 6, 4,... depending...

These are the maps to be loaded by Atlas when it is run.

For example, my Map command line - all one line -
Map.exe --fg-root=C:\FG\32\data --atlas=C:\FG\32\data\Atlas \
--palette=C:\FG\32\data\Atlas\Palettes\default.ap  --fg-scenery=C:\FG\32\data\scenery

Or a verbose form, NOT using the frame buffer extensions - render in window, as before...
Map.exe --verbose  --render-to-window --fg-root=C:\FG\32\data \
--atlas=C:\FG\32\data\Atlas --palette=C:\FG\32\data\Atlas\Palettes\default.ap \
--fg-scenery=C:\FG\32\data\scenery

2: Atlas: Usually some setup of needed data must be done, in
addition to the above map generation, before Atlas is run.
It needs to be able to load -
(a) backgound.jpg - to provided a global world image.
(b) Palettes\default.ap - to desinate the colors
(c) Fonts\Helvetica-Bold.100.txf and Helvetica.100.txf
(d) And the 'maps' in 10, 9, 8, etc.

Atlas.exe --fg-root=C:\FG\32\data --atlas=C:\FG\32\data\Atlas\temp2 --palette=C:\FG\32\data\Atlas\Palettes\default.ap --fg-scenery=C:\FG\32\data\Scenery

# EOF - README.msvc.txt

