Re: Using sprites en masse and fluctuating frame rates in C# MDX

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: charlie d (charlied_at_discussions.microsoft.com)
Date: 09/07/04


Date: Tue, 7 Sep 2004 03:21:01 -0700

ZMan, thanks for your replies thus far!

The PresentationInterval specification made massive differences. The
fluctuating stopped as well. I went from 60-40fps to 90fps, to 80fps at the
screen's busiest.

As for wanton memory usage, I think I'm travelling pretty light. The app
quits pretty quick, for one. CLRProfiler shows like 250k of stuff in the
stack, and from what I can tell there's a base of my own objects but it's
mostly Strings (presumably for ToStrings for Console.WriteLine and debug
calls) and random enumerators for ArrayLists and whatnot. I've tried to be
thorough about rooting out needless obj = new xyz in Update() and Render()
looped functions.

Now what I'm suspicious about is the speed of sprite rendering.

Like I said, with all my goodies going at full screen I'm getting 80-90fps.
But when I comment out the background rendering, I get 200fps ! My sprite
object's .draw(Sprite) function just sets the Transform matrix (just set,
assumes it's already calculated) and then calls Sprite.draw( .. ). I'm using
TextureLoader.FromFile to load textures... it's a 24bit 1024x768 jpg. I'll
fool around with it.

The fight continues...

Thanks so far!

c


Quantcast