NOGDUS

Articles, Tutorials, and other things. => Allegro Game Programming => : Richard Marks March 25, 2010, 04:53:27 PM



: Allegro Starter Kit
: Richard Marks March 25, 2010, 04:53:27 PM
Allegro Starter Kit

Version 9.0 of my project templates (http://storage.ccpssolutions.com/richard/ask/ASK-9.0.zip), gets itself a new name. ;D

Behold, the A.S.K. (Ay-ess-kay) - a few hundred lines to make starting an Allegro based project easier and faster.
You only need to concern yourself with 4 functions in order to get rolling.

I'll post some new tutorials soon that utilize this new project template (I chose starter kit for the new system, since I plan to be expanding on this every now and then, and as I do, it truly will become a starter kit - practically plug in the features you want and make your game.) :D

Anyway, the A.S.K. is comprised of 6 files:
  • AllegroStarterKit.h - the kit's current code base header (warning: don't mess with it unless you know what you are doing - doing so can cause problems needlessly. You can use the A.S.K. without modifying this file)
  • AllegroStarterKit.cpp - the kit's current code base (warning: don't mess with it unless you know what you are doing - doing so can cause problems needlessly. You can use the A.S.K. without modifying this file)
  • PrimaryWindow.h - the header file in which you will tie your game into the kit
  • PrimaryWindow.cpp - the source file in which you will tie your game into the kit
  • main.cpp - program entry point
  • startup.cfg - program startup configuration file

You can download the files in a .zip file by clicking here. (http://storage.ccpssolutions.com/richard/ask/ASK-9.0.zip)

You should treat the AllegroStarterKit.* files as a black-box, where you just use it, and don't mess with the internals.
At least, until you are versed in Allegro enough to drop A.S.K. and implement your own system. 8)

The startup.cfg file currently is somewhat strict in its format.
I just wanted something that worked, and not really bothered with making it very user friendly.
The format is simple, and is plain-text so you can edit the file in Notepad or whathaveyou.

The startup.cfg file consists of (at the time of this writing) three lines as follows:
:
Geometry=800x600@24
FullScreen=false
Caption=Allegro Starter Kit -- Richard Marks <ccpsceo@gmail.com>

The Geometry parameter can be any valid screen resolution or window size.
The @ part is the bit-depth of the video mode, so @24 means 24 bits per pixel.
You do need the lowercase x between the width and height of the desired video mode.

The FullScreen parameter can be true or false - if true, the program will run in full screen mode if possible (if not, it currently will lock up; sorry)

The Caption parameter will set the window caption text to whatever is on that line after the equals sign.

OK, thats all the explanation for now.
Let me know what you think, and if you have issues, etc.. lol



Sorry, the copyright must be in the template.
Please notify this forum's administrator that this site is missing the copyright message for SMF so they can rectify the situation. Display of copyright is a legal requirement. For more information on this please visit the Simple Machines website.