<almafeta.DeleteThis@gmail.com> wrote in message
news:c7d4d946-57a6-46f5-a44f-90843129d030@b15g2000hsa.googlegroups.com...
> On Nov 25, 9:35 pm, "Nik Coughlin" <nrkn.....DeleteThis@gmail.com> wrote:
>> Call the Win32 API instead. Console class in .NET is *slow*. Very
>> unfortunate
Especially if you want to target Mono as well.
>
> I'm using it, and I'm not seeing this very-slowness...
It seems to be OK here too now. The ast time I tried to use it was in
VS2005 in XP, now I'm running VS2008 on Vista. The code I tested with was
this (caution: ugly code follows):
Random r = new Random();
Console.Clear( );
while ( true ) {
for ( int y = 0; y < 20; y++ ) {
for ( int x = 0; x < 70; x++ ) {
Console.SetCursorPosition( x, y );
Console.ForegroundColor = (ConsoleColor) r.Next( 16 );
Console.Write( 'x' );
}
}
}
Further speed increases by only setting the cursor position in the Y loop.
In a Roguelike there would be further increases by only drawing what's
changed.
>> Stay informed about: C# PDCurses