Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Silverlight3-4(C#) port of Allegro 4.3.2

This thread is locked; no one can reply to it. rss feed Print
Silverlight3-4(C#) port of Allegro 4.3.2
Andrey Gayvoronsky
Member #12,308
October 2010

Hello everyone.

Recently i tried to reincarnate TimeWarp: http://timewarp.sourceforge.net/
with modern technologies (actually i dreamed to do it for many years, but after student time is over i had no time for such things). But now i have some free time and power to study something new. So i chose .NET platform, especially Silverlight.

And here is result - AllegroNET. It's not binding, it's real port. I would like to run Star Control in browser, that's why i can't use compiled binaries from original Allegro. So...AllegroNET is pure .NET port. I.e. you can use it with Silverlight 3-4, Windows Mobile 7, and other NET frameworks.

Project is still very young and will have some limitations. But anyway, main goal - cool library for 2D games on NET platforms.

Here is official site:
http://allegronet.codeplex.com/

Good Luck and Have Fun :)

---
.NET (Silverlight) port of Allegro:
http://allegronet.codeplex.com

kazzmir
Member #1,786
December 2001
avatar

I have consistently said that Timewarp is the greatest Allegro game ever made so I truly appreciate you trying to improve on it. It would be nice if you chose more Linux / open source technologies (or even flash, since it runs on linux) over .NET. I guess I'll try this on my windows 7 machine when I get home.

Can you post some screenshots?

<edit> Sorry I misunderstood, what you have done is just a port of Allegro the library to .NET. Ok, I guess thats nice. I think some other people tried it as well. Now go make timewarp!

Tobias Dammers
Member #2,604
August 2002
avatar

kazzmir said:

It would be nice if you chose more Linux / open source technologies (or even flash, since it runs on linux) over .NET

Ahem...

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

kazzmir
Member #1,786
December 2001
avatar

Is it common for .NET programs written on Windows to run easily on Mono as well? Or do people end up using proprietary modules that don't exist for Mono and can't be bothered to use portable components?

Andrey Gayvoronsky
Member #12,308
October 2010

>I have consistently said that Timewarp is the greatest Allegro game ever made so I >truly appreciate you trying to improve on it. It would be nice if you chose more >Linux / open source technologies (or even flash, since it runs on linux) over .NET. >I guess I'll try this on my windows 7 machine when I get home.

>Can you post some screenshots?

><edit> Sorry I misunderstood, what you have done is just a port of Allegro the >library to .NET. Ok, I guess thats nice. I think some other people tried it as well. >Now go make timewarp!

I ported Allegro (basic functionalities at least) and also ported partially Timewarp.

You can check it here:
http://gayvoronsky.com/test/

Actually it's already based on old version of library. On my notebook i have new version with all ships, but still have not time to finish some tasks to upload new version.

And please test it on Windows Mobile 7. AllegroNET should work on Windows Mobile 7. But StarConetrol - need to test. Windows Mobile using differ NET framework, so maybe i must do some tuning.

About Mono. Well, AllegroNET is compatible with Silverlight 3. Actually it's using just few things from that, but WritableBitmap exists only at Silverlight 3+. It uses only standart libraries, so no any additional dependences. But i didn't tested it.

Just try to run game from link that i provided up above. Maybe it will work without any tuning. I'm sure the only problem that can occur both on Windows Mobile and Linux - IsolatedStorage. I'm sure that WritableBitmap and IsolatedStorage are the only "critical" parts from framework and can't be replaced with anything other. Rest parts can be replaced if will make any troubles.

P.S.: I really thought alot about what to choose - Flash or Silverlight. But i considered that task not like pure port, but also as something new in my skillbase that i can use in future. And i'm sure that C# is better to study, than flash.

P.P.S.: I checked (quickly) specification of Moonlight 3.0 preview 6-7. Looks like it supports WritableBitmap and IsolatedStorage. So probably we have real chances to use AllegroNET and run StarCoNETrol on Linux :) But i don't have Linux, so i'm waiting for test by other :)

---
.NET (Silverlight) port of Allegro:
http://allegronet.codeplex.com

Kibiz0r
Member #6,203
September 2005
avatar

Quote:

BITMAP screen = Allegro.create_bitmap((int)GameScreen.Width, (int)GameScreen.Height, true);
GameScreen.Source = screen.source;

Holy naming conventions, Batman! .NET convention is PascalCase for types and public/protected/internal members, camelCase for private members and locals.

kazzmir said:

It would be nice if you chose more Linux / open source technologies (or even flash, since it runs on linux) over .NET.

In general, .NET/Mono is perfectly Linux-friendly, as I think I've said over 9000 times on this and other forums. However, Andrey has decided to target Silverlight, which Novell considers very experimental[1] and won't yet target for Mono development. There is Moonlight, which is a Linux Silverlight plug-in, but you'd still have to develop your Silverlight app in Windows.

kazzmir said:

Is it common for .NET programs written on Windows to run easily on Mono as well?

From what I've heard, it's pretty straight-forward. Some apps will just work, some need to sidestep some platform-specific calls, some are fundamentally based on platform-specific features and will be very hard to port. Much like porting C/C++, but you don't have to deal with compiler-specific bullshit. Also, Mono has a tool for aiding migration from .NET, called MoMA.

References

  1. With good reason. Silverlight has failed to capture a significant market share, and I heard a rumor that its sister technology, WPF, is essentially being discontinued in preference to Silverlight -- though that's probably nothing more than a rumor, it shows how little confidence people have in the technology.
Andrey Gayvoronsky
Member #12,308
October 2010

Kibiz0r said:

Holy naming conventions, Batman! .NET convention is PascalCase for types and public/protected/internal members, camelCase for private members and locals.

I tried to save function naming like at original Allegro, to decrease time for migration.

So it has almost nothing with naming at AllegroNET and NET.

Original Allegro:
create_bitmap(w,h);

AllegroNET:
Allegro.create_bitmap(w,h);

See? :)

---
.NET (Silverlight) port of Allegro:
http://allegronet.codeplex.com

Kibiz0r
Member #6,203
September 2005
avatar

I tried to save function naming like at original Allegro, to decrease time for migration.

As a new user, I would find it incredibly confusing that BITMAP is all-caps, GameScreen is PascalCase, GameScreen.Source is capitalized, BITMAP.source is not, and create_bitmap is lower-case underscored.

I also think that migrating from C to C# (especially with Silverlight) will involve a lot of design challenges that will be much more difficult to deal with than renaming function calls -- which they already have to do since the methods are in the Allegro static class.

Lots of libraries don't pay attention to naming their types appropriately for the platform they run on. Mechanically, it doesn't matter, but it does have an impact on perception and confidence. If my first impression is "Does this person really know .NET? This code doesn't look very .NET..." then I'm not likely to use the library.

james_lohr
Member #1,947
February 2002

So i chose .NET platform

Good choice!

Quote:

...especially Silverlight

Bad choice!

Andrey Gayvoronsky
Member #12,308
October 2010

Kibiz0r said:

As a new user, I would find it incredibly confusing that BITMAP is all-caps, GameScreen is PascalCase, GameScreen.Source is capitalized, BITMAP.source is not, and create_bitmap is lower-case underscored.

Well, you are right somewhere. But as i said, i would like to decrease time of migration. Anything except of Allegro uses .NET naming inside of my project. But i got you point about 'wow...does this guy know NET?' :))) And actually i'm still very new at NET :) although porting of TimeWarp + Allegro is quite competitive task :)

---
.NET (Silverlight) port of Allegro:
http://allegronet.codeplex.com

Go to: