Post Reply 
Social Buttons
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Intro to 2D Graphics: Installing Allegro
Author Message
Scorch Offline
Intermediate C++
********

Trade Count: (0)
Posts: 83
Joined: Jan 2011
Reputation: 15
Post: #1
Intro to 2D Graphics: Installing Allegro
That's one big title, but it is what this is about. I've decided to do some 2D graphics tutorials for this section.

This will be about installing Allegro. Allegro is a very fun 2D graphics library.

Taken from their website.
Quote:Allegro.cc is the most comprehensive website on the Internet pertaining to the Allegro Gaming Library. The Allegro library provides C/C++ programmers low level routines commonly needed in game programing, such as input, graphics, midi, sound effects, and timing. It is cross platform and works with many different compilers. Originally developed by Shawn Hargreaves, it is now a group project with contributions from all over the world! Some of its key features include:

Ease of Use - comes with comprehensive documentation and examples
Extensibility - if the built-in functionality isn't enough, there are many add-ons available
Cross Platform - without changing a single line of code, you can create versions for Windows, OS X, Linux, DOS, and others! Works with many compilers, including DJGPP and VC++
Open Source - anyone can contribute, including you!
Free - it won't cost you a dime, and there are no restrictions on its usage

You can see why it's a useful library.

Download the Allegro file here.

Put all the contents in the approporiate folders. You should also put any dlls in the system 32 folder to run your applications statically.

[Image: Allegroinstall.gif]

Once that is installed you can make an empty project. All you need to do include is liballeg.a to make the programs work.

To test if you installed it correctly run this example.
Code:
#include <allegro.h>//only header needed

int main()
{
    allegro_init();//initalize allegro
    install_keyboard();//allows use of the keyboard
    set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);//This scrren resolution is 640 480 in this example
    
    readkey();//equivilent of cin.get()
    
    return 0;
}  
END_OF_MAIN();//Define this to prevent errors

If this compiles fine then you have successfully installed allegro.
Next I will post about creating objects and moving them with the arrow keys.
(This post was last modified: 01-19-2011 01:12 AM by Scorch.)
01-19-2011 01:08 AM
Find all posts by this user Quote this message in a reply
Hidden Dragon Offline
Amazing
*******

Trade Count: (0)
Posts: 63
Joined: Jan 2011
Reputation: 4
Post: #2
RE: Intro to 2D Graphics: Installing Allegro
Hmmm I might have to look into this. I've wanted to make a 2D sidescroller.
01-19-2011 01:16 AM
Find all posts by this user Quote this message in a reply
Scorch Offline
Intermediate C++
********

Trade Count: (0)
Posts: 83
Joined: Jan 2011
Reputation: 15
Post: #3
RE: Intro to 2D Graphics: Installing Allegro
I'm actually working on a similar project right now. I've got the sprite, background, and physics.
I'm just working on an efficient way to scroll the background without lag. I figured out a way to last night fortunately.
(This post was last modified: 01-19-2011 01:21 AM by Scorch.)
01-19-2011 01:20 AM
Find all posts by this user Quote this message in a reply
Hidden Dragon Offline
Amazing
*******

Trade Count: (0)
Posts: 63
Joined: Jan 2011
Reputation: 4
Post: #4
RE: Intro to 2D Graphics: Installing Allegro
I know in a book I used previously it took about 5 chapters covering making a sprite, animating the sprite, getting the scroll, and all the other stuff you need. If I find it I'll be happy to share it with you.
01-19-2011 02:35 AM
Find all posts by this user Quote this message in a reply
Scorch Offline
Intermediate C++
********

Trade Count: (0)
Posts: 83
Joined: Jan 2011
Reputation: 15
Post: #5
RE: Intro to 2D Graphics: Installing Allegro
It's fine. I've got everything working right now.
01-19-2011 03:27 AM
Find all posts by this user Quote this message in a reply
Ironside Offline
Site Owner
**********

Trade Count: (0)
Posts: 170
Joined: Nov 2010
Reputation: 7
Post: #6
RE: Intro to 2D Graphics: Installing Allegro
Interesting, finally I'll learn something about these things.
01-19-2011 11:04 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: