예제 #1
0
        /// <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));
            }
        }
예제 #2
0
        /// <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));
            }
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }