This project is read-only.

What is AllegroNET?
Silverlight's implementation of Allegro(v4.2.3) library (http://alleg.sourceforge.net/)

The goal is to get completed library for fast/easy 2D bitmap manipulations, including sprites, collision detection and rest features for common 2D games.

Compatible with Silverlight 3+

The reasons for AllegroNET

Sadly, but Silverlight(up to version 4) has no fast and easy way to program 2D games. The only built-in way - use Image that actually is UIElement. It has cons(for example, perfect pixel collision detection), but also it has pros - a lot of "heavy functionality" that comes with UIElement and MAJOR minus - no direct access to image data. The only way to work directly with image data - using WriteableBitmap. But the next problem that you will get - WriteableBitmap has no any basic protection, clipping and other features. It's just a raw array of int. So what we will have if we want to develop 2D game and stick with built-in functionality of Silverlight?!

  1. Use one of "heavy" UIElement(Image and etc) and get quite slow game or quite high CPU load(the main purpose of UIElement - create Rich User Interfaces, not games)
  2. Use fast WriteableBitmap, but without any buil-in functionality for image manipulation. No blit, no primitives, no boundaries checking, no clipping - nothing.

That's why was chosen other way - port one of already existing popular open-source library that is using for games (it must be cross-platfrom library to decrease time of porting - it already has most cases/solutions for differ platforms). There are a lot libraries. Probably most popular - SDL. Sadly, but i had experience only with Allegro. That's why AllegroNET was born.

The goal of AllegroNET

The main goal - port most functionality for bitmap manipulations - sprites(including perfect pixel collision detection), image processing(blit, rotate, stretch and etc), drawing primitives.

The differences AllegroNET from original Allegro

  1. First of all, only 32bit images/sprites is supported.
  2. Some functions can be extended. For example, create_bitmap has one more additional overloaded version for using with WriteableBitmap.
  3. Algorithms for drawing primitives can differ from original version(for example, there are a few quite fast ways to draw line). 
  4. Some additional library can be integrated. For example, right now already integrated PPCOL library (Perfect Pixel Collision Detection).
  5. Encrypted DataFiles is not supported. Also individual compression is not supported. Only global.

Current project state of AllegroNET.  What functionalities are already ported?

  • Basic image processing/manipulation 
  • Drawing primitives
  • Sprites
  • Perfect Pixel Collision Detection
  • DataFiles

Known projects with AllegroNET

  1. Star CoNETrol - My port of Star Control - Timewarp (coded in Allegro in the deep past). I was in development team in the deep past(1999-2000), but i wanted to reincarnate that project(at least last official release - v0.5) with modern technologies. Also it was my first try to learn C#/Silverlight. Project is not finished yet, but you can see results of using AllegroNET :)

To do

  • Port rest major functionality from original library
  • Speed optimization(Although library is already quite fast). Right now main task - port major functionality. Some speed optimization can be done (for example, replace divide/multiply for bit-shifting), but it's not critical.
  • Documentation and examples for using that library (although you can easily use documentation from original library, but as was mentioned before - some functionality can be extended)

Last edited Oct 12, 2010 at 9:49 PM by plandem, version 18