@html_text_substitution=readme.txt|<a href="../readme.html">readme.txt</a>
@external-css=../allegro.css
@document_title=Allegro DMC-specific information
@<pre>
     ______   ___    ___
    /\  _  \ /\_ \  /\_ \
    \ \ \L\ \\//\ \ \//\ \      __     __   _ __   ___ 
     \ \  __ \ \ \ \  \ \ \   /'__`\ /'_ `\/\`'__\/ __`\
      \ \ \/\ \ \_\ \_ \_\ \_/\  __//\ \L\ \ \ \//\ \L\ \
       \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
	\/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
				       /\____/
				       \_/__/


		 DMC-specific information.

	 See readme.txt for a more general overview.
@</pre>



@heading
DMC notes

   Status: complete.
   
   Caveats: The DMC runtime library does not support unicode paths.
      
   DMC is the only Windows compiler that can build a static library that can
   be used with DAllegro.
   
   The instructions at <link>http://wiki.allegro.cc/Build/DMC</a> might be 
   more up to date.



@heading
Required software

   <ul><li>Digital Mars C/C++ Compiler - <link>http://www.digitalmars.com/d/1.0/download.html</a>
   <li>Digital Mars Basic Utilities - <link>http://ftp.digitalmars.com/bup.zip</a>
   <li>GNU Make - <link>http://sourceforge.net/project/showfiles.php?group_id=9328</a>
   <li>Recent set of DirectX and other Windows SDK headers. - <link>http://alleg.sourceforge.net/files/dx70_dmc.zip</a>
   </ul>



@heading
Setting up DMC

   <ol><li>Unzip the Digital Mars compiler (dmc.zip) and place the files in c:\dmc.
   <li>Unzip the Basic Utilities (bup.zip) and place them in the same folder.
   (The exe files should all be in the c:\dmc\bin folder.)
   <li>Unzip the DirectX 7 package (dx70_dmc.zip) and place the include files
   in c:\dmc\include and the library files in c:\dmc\lib. (This will overwrite
   some of DMC's default DX files.)
   <li>Extract only the usr/local/wbin/make.exe file from UnxUtils.zip to your
   desktop, rename it to gmake.exe, and copy it to c:\dmc\bin.
   <li>Add c:\dmc\bin to your PATH environment variable.
   <li>Create the DMCDIR environment variable and set it to c:\dmc
   </ol>



@heading
Building Allegro

@hnode Step by Step Instructions

   <ul><li>Extract the Allegro source zip file to c:\allegro
   <li>Open up a MS-DOS prompt and type the following commands.
   </ul>   
<textblock>
   cd\allegro   
   fix dmc   
   gmake obj\dmc\plugins.h
   gmake all STATICLINK=1
   gmake installall STATICLINK=1
   gmake all
   gmake installall
<endblock>
   
@hnode Advanced Build Options

   The above instructions build six versions of Allegro, the Demo, tools,
   examples, and the documentation. If you don't need all of that, you can
   customize what gets built. Obviously, if you don't need both the static or
   dynamic libraries, simply don't run the associated commands. If you don't
   care about the Debugging or Profiling versions, you can remove the word all
   from the command line. For example:

<textblock>
   gmake
   gmake install
<endblock>

   builds and installs the optimized, dynamic Allegro library along with all of
   the examples, documents, etc. Or if you want to specifically build and
   install the debug and profiling versions:

<textblock>
   gmake DEBUGMODE=1
   gmake install DEBUGMODE=1
   gmake PROFILEMODE=1
   gmake install PROFILEMODE=1
<endblock>

   If you only want to build the library (without the extra stuff), specifically
   request to make the lib target:

<textblock>
   gmake lib
<endblock>

   That would only build the optimized, dynamic Allegro library. Other targets
   besides lib exist; refer to Makefile.all and Makefile.dmc for more
   information. All of the options can be mixed and matched where it makes
   sense.



@heading
Using Allegro

@hnode Hello World

   For a simple example, consider hello.c:

<codeblock>
   #include &ltallegro.h>

   int main(void)
   {
           allegro_init();
           set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0,0);
           allegro_message("Hello, World!");
           return 0;
   }
   END_OF_MAIN()
<endblock>

   First, you must include the Allegro header file. Inside the main function,
   you should call allegro_init() to set up Allegro. You must do that before
   calling (almost) any of the other Allegro functions. (This program will
   create a 640x480 window and then pop-up the message "Hello, World!".)
   At the end of the main function, you must include the END_OF_MAIN() 
   macro (no semicolon is needed).

@hnode Dynamic Version (DLL)

   To compile this program, type:

<textblock>
   dmc -c test.c
<endblock>

   This will create the object file. It will then need to be linked to Allegro
   when you create the executable:

<textblock>
   dmc test.obj alleg.lib -otest.exe
<endblock>

   That will build test.exe, which will require the Allegro DLL (eg: alleg42.dll)
   to run. Alternatively you could use allp.lib for profiling or alld.lib for
   debugging.
   
@hnode Static Version

   If you wanted to statically link this program so that the Allegro DLL is not
   required, you must first compile it like:

<textblock>
   dmc -c test.c -DALLEGRO_STATICLINK=1
<endblock>

   Then you can link it against any of the static versions of Allegro:

<textblock>
   dmc test.obj alleg_s.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib
      ole32.lib dinput.lib ddraw.lib winmm.lib dsound.lib dxguid.lib
<endblock>

(All of that should be entered on one line.) Note that you have to include a
bunch of Windows libraries when you statically link! As before, you can also
use allp_s.lib for profiling and alld_s.lib for debugging. 

