Power Render Installation Guide
-------------------------------

Table of Contents
-----------------
1.1 - Watcom/DOS Version
1.2 - Watcom/WinGlide Version
1.3 - Watcom/DirectDraw Version
2.1 - MSVC/WinGlide Version
2.2 - MSVC/DirectDraw Version
3.1 - General Windows Notes

---------------------------------------------------------------------
1.1 - Watcom/DOS Version
---------------------------------------------------------------------
The first thing you should do is add the \pr\bin directory to your
path environment variable.  You must do this by editing your autoexec.bat
file on drive C.  This will allow you to run the utilities from any
directory on your system.  


You need Watcom C/C++ 10.6 or later, and WGT 5.1 installed.  WGT 5.1 also
has a trial version available from our web site (http://www.egerter.com).  

Most people will probably have problems with undefined symbols because
they didn't set up the include and library paths correctly.  I put the
WGT include path in my autoexec.bat (set include=...), and modified
the wlsystem.lnk file so it finds the libraries without specifying the path.
The makefiles included with this package require that you do this as well.

For example, the dos4g section of my wlsystem.lnk file located in the
watcom\binw directory looks like this:

system begin at_dos4g
    option osname='DOS/4G'
    libpath %WATCOM%\lib386
    libpath %WATCOM%\lib386\dos
    libpath c:\wgt5\lib
    op stub=wstub.exe
    format os2 le
end

If you are experiencing errors such as "undefined symbol int386" then
you have Watcom installed incorrectly.  Look in your autoexec.bat file
and make sure the Watcom NT include and path variables come after the
regular directories.  The problem is the compiler finds the NT include
files and executables first, and tries to use them to compile DOS programs.
There is a compiler parameter called bt (base target) that controls the
definition of the OS macros (ie __NT__).   Set it to  bt=DOS and it defines
the OS macro __DOS__ instead of __NT__.  

To make your own program, create a new directory under examples and
copy one of the example makefiles.  Modify the file so it uses the filename
of your C file.  Projects with multiple source files will need modification
to the prex.mk file.

Only Glide 2.3 and later are supported now.  The programs have been tested
with Glide 2.43.

!IMPORTANT!
The makefiles need a few modifications before you can compile the examples.
The files that need to be changed are \pr\pr.mk and \pr\prex.mk.
pr.mk is used to build the utilities, and prex.mk is used for the examples.

The following variables should be changed in both makefiles:
version = RETAIL or DEBUG
hardware = 3DFX or NONE
INSTALL_DIR = d:\pr (the base directory where Power Render is installed)
GLIDE_DIR   = D:\glide24 (the base directory where Glide is installed) 

You can then compile all of the utilities by running the build.bat file
from the \pr\util directory.

A batch file for compiling all of the examples is found in the \pr\examples
directory.

---------------------------------------------------------------------
1.2 - Watcom/WinGlide Version
---------------------------------------------------------------------
Projects for the utilities are found in \pr\winutil\wtglide.
Projects for the examples are found in \pr\winex\wtglide.

You must change the following options for each project:

Options / Windows Linking Switches / Import, Export, and Library Switches
  - Modify the library pathnames for your system

Options / C Compiler Switches
  - Modify the include pathnames for your system

---------------------------------------------------------------------
1.3 - Watcom/DirectDraw Version
---------------------------------------------------------------------
Projects for the utilities are found in \pr\winutil\wtdd.
Projects for the examples are found in \pr\winex\wtdd.

You must change the following options for each project:

Options / Windows Linking Switches / Import, Export, and Library Switches
  - Modify the library pathnames for your system

Options / C Compiler Switches
  - Modify the include pathnames for your system

---------------------------------------------------------------------
2.1 - MSVC/WinGlide Version
---------------------------------------------------------------------
A workspace containing the utility projects is found in the
\pr\winutil\msglide directory.

Workspaces for the examples are found in the \pr\winex\msglide\examples and
\pr\winex\msglide\terrain directories.

Before compiling any of these programs you must have DirectX and Glide
installed.  These programs have been tested with DirectX 5 and Glide 2.4.
To configure the Developer Studio, go into the Tools/Options/Directories
options, and set up the following include directories:

d:\dxsdk\sdk\inc                        (Main DirectX files)
d:\dxsdk\sdk\samples\misc               (Util DirectX files)
...
Standard MSVC include directories.
I had the DirectX 5 directories before these, so the older header files
that came with MSVC were not used.
...
d:\glide24\glide\src\sst1\include       (Main Glide files)
d:\glide24\glide\src\swlibs\texus\lib   (Texus files)
f:\pr\winclude\msglide                  (Power Render files)

As well, you have to set up the library directories as follows:
d:\dxsdk\sdk\lib
...
Standard MSVC library directories
...
d:\glide24\glide\lib\win32
f:\pr\winlib\msglide


You only have to do this once, not for each workspace.  If you are trying
both WinGlide and DirectDraw versions you will have to swap the order of
these directories so the one you are using is listed first.  Using the
DirectDraw include files with WinGlide libraries probably isn't a good idea :)

Now you should be able to compile all of the programs individually or by a
batch build.  The executable utilities will be placed in the \pr\winbin
directory, and the examples will be put into the \pr\examples\... directory.
The examples are called winex##.exe, and the terrain example is called
winland.exe.  Make sure you run these programs from their own directories so
the data files can be found.


---------------------------------------------------------------------
2.2 - MSVC/DirectDraw Version
---------------------------------------------------------------------
A workspace containing the utility projects is found in the
\pr\winutil\msdd directory.

Workspaces for the examples are found in the \pr\winex\msdd\examples and
\pr\winex\msdd\terrain directories.

Before compiling any of these programs you must have DirectX installed.
These programs have been tested with DirectX 5.
To configure the Developer Studio, go into the Tools/Options/Directories
options, and set up the following include directories:

d:\dxsdk\sdk\inc                        (Main DirectX files)
d:\dxsdk\sdk\samples\misc               (Util DirectX files)
...
Standard MSVC include directories.
I had the DirectX 5 directories before these, so the older header files
that came with MSVC were not used.
...
f:\pr\winclude\ddraw                    (Power Render files)

As well, you have to set up the library directories as follows:
d:\dxsdk\sdk\lib
...
Standard MSVC library directories
...
f:\pr\winlib\msdd


You only have to do this once, not for each workspace.  If you are trying
both WinGlide and DirectDraw versions you will have to swap the order of
these directories so the one you are using is listed first.  Using the
DirectDraw include files with WinGlide libraries probably isn't a good idea :)

Now you should be able to compile all of the programs individually or by a
batch build.  The executable utilities will be placed in the \pr\winbin
directory, and the examples will be put into the \pr\examples\... directory.
The examples are called winex##.exe, and the terrain example is called
winland.exe.  Make sure you run these programs from their own directories so
the data files can be found.


---------------------------------------------------------------------
3.1 - General Windows Notes  
---------------------------------------------------------------------

If you need to build the projects and/or workspaces yourself, you will
need the following:

Preprocessor defines:
__MSC__  (MSVC only)
__3DFX__ (WinGlide only)
MSGLIDE  (MSVC WinGlide Only)
WTGLIDE  (Watcom WinGlide only)
MSDD     (MSVC DirectDraw)
WTDD     (Watcom DirectDraw)

You must also use the /Zp1 compiler switch on all source files.  This uses
byte alignment for structures.  


DirectInput is used by the utilities and examples.  Both mouse and keyboard
are used, but the mouse is automatically initialized by the winutil module.
You should not attempt to use the minit command again in your program.

Keyboard input has two different modes.  After calling installkbd, each
key is either up or down.  These states can be obtained from the kbdon
array, and the keyboard defines are found in the prdef.h file.  This mode is
used for realtime situations where you need to read input every frame.

After uninstallkbd is called, all keyboard input is put into a queue
and can be read using the PR_kbhit and PR_getch commands (found in winutil.c).
This mode is used for reading strings from the user.  

Not all of the utilities have been compiled for Win32.  These include
maketab, dumppro, pic2wmp, and sprmip.  The compiled versions of these
utilities are provided in the \pr\bin directory.

The first example has not been compiled for Win32 because it was specifically
for 320x200 VGA mode.

The PRSOUND library will use DirectSound for mixing if installed.

