To main portal : Using Allegro with Visual C++

Easy Way to Create E-Greetings in C++ Easy Way to Build MySQL Client Programs in C++ Easy Way to Use MySQL++ Build Your Own File Encryption Program in C++ Use C# to Build Your Own eBook Easy Way to Use SQLite with C#

Using Allegro with Visual C++ - How to Get Started the Easy Way

This guide is dated June 2006 and refers to Allegro 4.2.0.

If you are using Visual C++ here are the steps to get you up to speed with Allegro. There is no need to compile Allegro. You will be able to get the compiled binaries of Allegro, all its tools, demo and example programs.

Step 1 - Get the full source codes

It is important to get the full source codes. This package comes not only with the Allegro source but also include source codes of the tools, a demo, and many example programs.

The download page is at http://alleg.sourceforge.net/wip.html. At the download page, in Stable branch 4.2.0 source releases, you can download the full source from this URL-- http://prdownloads.sourceforge.net/alleg/all420.zip?download


Step 2 - Get the reference manuals

Download the API reference from here. The documentation webpage is at http://www.talula.demon.co.uk/allegro/api.html

The download links for the .chm and PDF files are:
http://prdownloads.sourceforge.net/alleg/allegro-manual-4.2.0.en.chm?download
http://prdownloads.sourceforge.net/alleg/allegro-manual-4.2.0.en.pdf?download


Step 3 - Get the pre-compiled binaries

At this http://alleg.sourceforge.net/wip.html page there is a section: Binary version (only for Windows) Allegro binary package
The SourceForge URL is http://sourceforge.net/project/showfiles.php?group_id=5665&package_id=168871

The files available for download are:

You can download whichever version you need. I'm using Visual C++ 6.0 so I have downloaded allegro-msvc6-4.2.0.zip.
The allegro-msvc6-4.2.0.zip contains three folders: bin, include and lib.
The bin folder contains alld42.dll, alleg42.dll and allp42.dll.
The include folder contains all the header files that you need.
The lib folder contains the libraries for linking with your Allegro programs.

Note that this file does not contain pre-compiled binaries of the tools, demo and example programs.

You should also download the other two DevPak files. They contain the pre-compiled binaries of the tools, demo and example programs.

Step 4 - Install the runtime files

In the bin folder of this file, allegro-msvc6-4.2.0.zip, are the runtime files:  alld42.dll, alleg42.dll and allp42.dll.
Copy them to your Windows system directory, in my case it is this folder--C:\WINNT\system32


Step 5 - Build a VC++ workspace for Allegro development

I have created a workspace and projects in Visual C++ 6.0 that use Allegro 4.2.0
Project workspace is vc6allegro and it contains two projects: DllAlleg and StaticAlleg with a simple test program.

DllAlleg is a project that use the Allegro DLLs. In this project are 3 configurations: Release, Debug and Profile
StaticAlleg is for projects that static link with the Allegro library, so no dependency on Allegro DLLs. In this project, there are 3 configurations: Release, Debug and Profile

If you are using Visual C++ 6.0, you can download vc6allegro.

Step 6 - Getting the necessary pre-compiled tools

Allegro comes with several useful tools: For absolute beginners, two important and essential tools to learn are grabber.exe and exedat.exe. The tools are in: allegro-4.2.0-1mol.DevPak, in the bin folder. DevPak is actually in a tar.bz format so you can use 7-zip to open the archive and extract the files. Note that Winzip cannot open a DevPak file.

Step 7 - Getting the binaries of demo, examples and tests

The pre-compiled binaries of the demo, example and tests are in this archive file: allegro_supplement-4.2.0-1mol.DevPak You can use 7-zip to extract the binaries from these folders in the devpak: demo, examples, tests.

Step 8 - Study the source code examples.

For beginners who are using Allegro in Windows, I recommend these programs to study first. With the knowledge gained from these you should be able to code a simple game and be able to study the other advanced example.programs.

  1. exhello.c
  2. exbitmap.c
  3. exdata.c
  4. exdbuf.c
  5. exexedat.c
  6. exkeys.c
  7. exmem.c
  8. exmidi.c
  9. exmouse.c
  10. exsample.c
  11. exsprite.c
  12. extimer.c

Refer to the reference manuals when reading these. Run them too.

This is the end of this guide. I hope it is useful to you. There is another Allegro webpage at this site. It lists URLs of websites that contain Allegro resources and also a download link for a very simple Allegro game, complete with source codes. This project was built using Code::Blocks IDE with GCC compiler (Windows version).





more FREE downloads at Main Site