Exemplo n.º 1
0
 /// <summary>
 /// ゲーム コンポーネントとしての登録が解除される時に、
 /// 静的シングルトン フィールドから自身を削除します。
 /// </summary>
 /// <param name="sender">イベントのソース。</param>
 /// <param name="e">イベント データ。</param>
 void OnComponentRemoved(object sender, GameComponentCollectionEventArgs e)
 {
     if (e.GameComponent == this)
     {
         instance = null;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// ゲーム コンポーネントとしてインスタンスが登録される時に、
 /// 静的シングルトン フィールドへ自身を設定します。
 /// </summary>
 /// <param name="sender">イベントのソース。</param>
 /// <param name="e">イベント データ。</param>
 void OnComponentAdded(object sender, GameComponentCollectionEventArgs e)
 {
     if (e.GameComponent == this)
     {
         instance = this;
     }
 }
Exemplo n.º 3
0
        protected override void Initialize()
        {
            #region ���M���O

            logger.Info("Initialize");

            EnvironmentLog.Info();
            GraphicsAdapterLog.Info();

            #endregion

            #region FPS �J�E���^

            var fpsCounter = new FpsCounter(this);
            fpsCounter.Content.RootDirectory = "Content";
            fpsCounter.HorizontalAlignment = DebugHorizontalAlignment.Right;
            fpsCounter.SampleSpan = TimeSpan.FromSeconds(2);
            //fpsCounter.Enabled = false;
            //fpsCounter.Visible = false;
            Components.Add(fpsCounter);

            #endregion

            #region �^�C�� ���[��

            timeRuler = new TimeRuler(this);
            timeRuler.BackgroundColor = Color.Black;
            timeRuler.Visible = false;
            Components.Add(timeRuler);

            #endregion

            #region ���j�^

            monitorListener = new TimeRulerMonitorListener(timeRuler);
            Instrument.Listeners.Add(monitorListener);

            int barIndex = 0;

            monitorListener.CreateMarker(InstrumentUpdate, barIndex, Color.White);

            barIndex++;
            monitorListener.CreateMarker(PartitionManager.InstrumentUpdate, barIndex, Color.Cyan);
            barIndex++;
            monitorListener.CreateMarker(PartitionManager.InstrumentCheckPassivations, barIndex, Color.Orange);
            monitorListener.CreateMarker(PartitionManager.InstrumentCheckActivations, barIndex, Color.Green);
            monitorListener.CreateMarker(PartitionManager.InstrumentPassivate, barIndex, Color.Red);
            barIndex++;
            monitorListener.CreateMarker(ChunkManager.InstrumentProcessProcessBuildVerticesRequests, barIndex, Color.Green);
            barIndex++;
            monitorListener.CreateMarker(ChunkManager.InstrumentProcessChunkTaskRequests, barIndex, Color.Yellow);
            barIndex++;
            monitorListener.CreateMarker(ChunkManager.InstrumentUpdateMeshBuffers, barIndex, Color.Magenta);

            barIndex++;
            monitorListener.CreateMarker(RegionManager.InstrumentUpdate, barIndex, Color.White);

            barIndex++;
            monitorListener.CreateMarker(InstrumentDraw, barIndex, Color.White);

            barIndex++;
            monitorListener.CreateMarker(SceneManager.InstrumentDraw, barIndex, Color.Cyan);
            barIndex++;
            monitorListener.CreateMarker(SceneManager.InstrumentDrawShadowMap, barIndex, Color.Cyan);
            monitorListener.CreateMarker(SceneManager.InstrumentDrawScene, barIndex, Color.Orange);
            monitorListener.CreateMarker(SceneManager.InstrumentOcclusionQuery, barIndex, Color.Green);
            monitorListener.CreateMarker(SceneManager.InstrumentDrawSceneObjects, barIndex, Color.Red);
            monitorListener.CreateMarker(SceneManager.InstrumentDrawParticles, barIndex, Color.Yellow);
            monitorListener.CreateMarker(SceneManager.InstrumentPostProcess, barIndex, Color.Magenta);

            #endregion

            #region �e�N�X�`�� �f�B�X�v���C

            textureDisplay = new TextureDisplay(this);
            textureDisplay.Visible = false;
            Components.Add(textureDisplay);

            #endregion

            base.Initialize();
        }
Exemplo n.º 4
0
 /// <summary>
 /// ゲーム コンポーネントとしての登録が解除される時に、
 /// 静的シングルトン フィールドから自身を削除します。
 /// </summary>
 /// <param name="sender">イベントのソース。</param>
 /// <param name="e">イベント データ。</param>
 void OnComponentRemoved(object sender, GameComponentCollectionEventArgs e)
 {
     if (e.GameComponent == this) instance = null;
 }
Exemplo n.º 5
0
 /// <summary>
 /// ゲーム コンポーネントとしてインスタンスが登録される時に、
 /// 静的シングルトン フィールドへ自身を設定します。
 /// </summary>
 /// <param name="sender">イベントのソース。</param>
 /// <param name="e">イベント データ。</param>
 void OnComponentAdded(object sender, GameComponentCollectionEventArgs e)
 {
     if (e.GameComponent == this) instance = this;
 }