/// <summary>処理にかかった時間を計算する。</summary> public void CalculateProcessTime(DebugString debugString) { float ticksPerFrame = Stopwatch.Frequency / 60.0f; int preIndex = (index == 0) ? 1: 0; for (int i = 0; i < count; ++i) { timePercent[i] = (time[preIndex, i + 1] - time[preIndex, i]) / ticksPerFrame; debugString.WriteLine(string.Format("{0}={1,6:N}%", pinName[i], timePercent[i] * 100)); } }
/// <summary>処理にかかった時間を計算する。</summary> public void CalculateProcessTime(DebugString debugString) { float ticksPerFrame = Stopwatch.Frequency / 60.0f; int preIndex=(index==0) ? 1: 0; for(int i=0; i<count; ++i) { timePercent[i]=(time[preIndex, i+1]-time[preIndex,i])/ticksPerFrame; debugString.WriteLine(string.Format("{0}={1,6:N}%", pinName[i], timePercent[i] * 100)); } }
public virtual void Initialize() { Console.WriteLine("Initialize()"); stopwatch = new Stopwatch(); stopwatch.Start(); preSecondTicks=stopwatch.ElapsedTicks; graphics = new GraphicsContext(); graphics.SetClearColor(0.0f, 0.0f, 0.0f, 0.0f); graphics.Enable(EnableMode.Blend); graphics.Enable(EnableMode.DepthTest); graphics.SetBlendFunc(BlendFuncMode.Add, BlendFuncFactor.SrcAlpha, BlendFuncFactor.OneMinusSrcAlpha); debugString = new DebugString(graphics); }
public virtual void Initialize() { Console.WriteLine("Initialize()"); stopwatch = new Stopwatch(); stopwatch.Start(); graphics = new GraphicsContext(); graphics.SetClearColor(0.0f, 0.0f, 0.0f, 0.0f); graphics.Enable(EnableMode.Blend); graphics.Enable(EnableMode.DepthTest); graphics.SetBlendFunc(BlendFuncMode.Add, BlendFuncFactor.SrcAlpha, BlendFuncFactor.OneMinusSrcAlpha); textureFont = new Texture2D("/Application/resources/DebugFont.png", false); debugString = new DebugString(graphics, textureFont, 10,20); }