The easiest program language using C++ for game Programming/making!
1.1 Introduction & Installing the Library
If you notice anything that isn't correct/isn't working for you. Please reply and I'll fix it/help you with your problem (as long as it's not to complicated.. as I'm not that far in allegro)
what do you need to know to complete this tutorial?
Some basics, like:
- Int, char, bool
- Loops
I recommend that you at least saw 1-20 from antiRTFM's tutorials.
If you want to continue doing even more Allegro, then please. View a little bit more (up to 30)
Well, lets get started!
Now, the thing about Allegro is that you got to include the Allegro library.
Unfortunately, this is not just done by typing #include <allegro.h>, but you got to download the library.
How this is done:
Dev-C++,
I got this compiler (just cuz it's INCREDIBLY easy with this one).
Go to 'tools>>check for updates/packages'.
A window will open, from here select 'devpaks.org' from the drop down menu.
Press check for updates, and their you go, all the library's that you can download from the site!
Now scroll down and look for Allegro (just pick the newest version).
All you got to do now is, after you created your project add the library to it.
How are you going to do this? Well, easy!
Go to 'Projects>>Project Options'.
Click on the Parameters tab.
Click on the add library or object button.
Go to the directory where you installed dev-c++, and find the file liballeg.a
This should be in 'Dev-c++/lib'
Visual Studios
Instead of typing a whole tutorial on Visual Studios edition there are a couple links here to use. Go here http://www.allegro.cc/files/ to get the Allegro files needed. To know what version of Visual Studios have and what service pack is installed go to help menu and click on about Microsoft Visual Studios. Then look for the version and service pack it is. This will tell you which file to download. After you download and extract put the folder somewhere convenient easy to find(DO NOT put it in the project your making)This needs to get accessed every time you make an Allegro project.
You now have two choices set up the include and library every single time you make a project OR do it once and be over with it. Since I'm such a nice guy I will explain both. These methods are how to install any kind of libraries if you decide Allegro is not for you this tut will help for the most part. We will do the one time option first.
1 time option:
In Visual Studios with you project open got to Tools/Options... and then open the tree Projects and Solutions and click on VC++ Directories. In that there should be a drop down list under Show directories for: it will say Executable Files set that to Include Files and click on the new folder button or scroll down to the empty line and double click there should be three (...) click on the that on go to the Allegro folder and click on include folder and then say select folder. Now do the same instead of Include Files set it to Library Files and do the same except choose the Lib folder and set. You are now set up in this part and don't have to do it anymore.
2 every time option:
Go to your Project Properties and open up your Configuration Properties tree go down and click on C/C++ and click on it or open the tree and click on general (same thing)Click on Additional Include Directories do the same thing as above find and set include folder. Then either click on Linker or open tree and click on general find Additional Library Directories and you guessed it find and set the Lib folder.
Ta-dah, you are set up and hopeful ready for the next part
Now go to this site http://www.allegro.cc/docs/windows-msvc7-use.html and it will tell how to set up a project in Visual Studios.( I believe win32 project and not win32 console makes a difference) I didn't see it mentioned on the tutorial I may have missed it but if it compiles but then gives an error when you attempt to run copy (not cut) the .dll's for the Allegro bin folder (should be three) and paste them in the same folder that the .exe. is in. You should be able to run it then. Here is your test program(it's also on the bottom of the website given)
- Code: Select all
#include <allegro.h>
int main()
{
allegro_init();
allegro_message("Hello World");
return 0;
}
END_OF_MAIN();
Well hopefully all went well and now that we have just finished doing software surgery we can actually go and learn some graphic programming.(How embarrassing a antique like dev is 10 times easier to set up, well I guess we can feel like sophisticated geeks with our sophisticated software)
any problems with setting up just ask.
where noobs teaching noobs but having fun in the process.
More compilers will be added soon
Their! wooh now you're all set to start Programming in Allegro!!!
