Have a look at the following sample... Call the CalculateFrameRate each time you render to the device, and either display it to the device in code or change you forms title text to display it ie. thisform1.title.txt = CalculateFrameRate().ToString();
using System; using System.Collections.Generic; using System.Text;
namespace VirtualRealm.Mdx.Common { public class Utility { #region Basic Frame Counter
private static int lastTick; private static int lastFrameRate; private static int frameRate;
public static int CalculateFrameRate() { if (System.Environment.TickCount - lastTick >= 1000) { lastFrameRate = frameRate; frameRate = 0; lastTick = System.Environment.TickCount; } frameRate++; return lastFrameRate; } #endregion
How do I display Frames Per Second?
BusmasterJones
James Grant
Have a look at the following sample... Call the CalculateFrameRate each time you render to the device, and either display it to the device in code or change you forms title text to display it ie. thisform1.title.txt = CalculateFrameRate().ToString();
using System;
using System.Collections.Generic;
using System.Text;
namespace VirtualRealm.Mdx.Common
{
public class Utility
{
#region Basic Frame Counter
private static int lastTick;
private static int lastFrameRate;
private static int frameRate;
public static int CalculateFrameRate()
{
if (System.Environment.TickCount - lastTick >= 1000)
{
lastFrameRate = frameRate;
frameRate = 0;
lastTick = System.Environment.TickCount;
}
frameRate++;
return lastFrameRate;
}
#endregion
}
}
Flaatten
Every example I've seen requires working it out by using a timer and counting how many times a second the screen gets refreshed.
But it's possible that it's sitting in there also, it's been a while since I did DX.
pravin333
t_girl