Esempio n. 1
0
        /// <summary>
        /// Draw the scene.
        /// This method is called every frame. Don't call it manually.
        /// </summary>
        protected void DrawScene(GameTime gameTime)
        {
            CCDrawManager.PushMatrix();

            // draw the scene
            if (m_pRunningScene != null)
            {
                m_pRunningScene.Visit();
            }

            // draw the notifications node
            if (m_pNotificationNode != null)
            {
                NotificationNode.Visit();
            }

            ShowStats();

            CCDrawManager.PopMatrix();

            m_uTotalFrames++;

            if (m_bDisplayStats)
            {
                CalculateMPF();
            }
        }
Esempio n. 2
0
        protected void Draw(CCGameTime gameTime)
        {
            // Only draw stats if they are enabled.
            if (Stats.IsEnabled)
            {
                Stats.UpdateStart();
            }

            DrawManager.PushMatrix();

            foreach (CCDirector director in sceneDirectors)
            {
                CCScene runningScene = director.RunningScene;

                // draw the scene
                if (runningScene != null)
                {
                    runningScene.Visit();

                    Renderer.VisitRenderQueue();

                    if (EventDispatcher.IsEventListenersFor(EVENT_AFTER_VISIT))
                    {
                        EventDispatcher.DispatchEvent(eventAfterVisit);
                    }
                }

                // draw the notifications node
                if (NotificationNode != null)
                {
                    NotificationNode.Visit();
                }

                if (EventDispatcher.IsEventListenersFor(EVENT_AFTER_DRAW))
                {
                    EventDispatcher.DispatchEvent(eventAfterDraw);
                }
            }

            DrawManager.PopMatrix();

            // Only draw stats if they are enabled.
            if (Stats.IsEnabled)
            {
                Renderer.PushGroup();
                Renderer.PushViewportGroup(ref defaultViewport);
                Renderer.PushLayerGroup(ref defaultViewMatrix, ref defaultProjMatrix);

                DrawManager.UpdateStats();
                Stats.Draw(this);

                Renderer.PopLayerGroup();
                Renderer.PopViewportGroup();
                Renderer.PopGroup();

                Renderer.VisitRenderQueue();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Draw the scene.
        /// This method is called every frame. Don't call it manually.
        /// </summary>
        protected void DrawScene(GameTime gameTime)
        {
            if (m_NeedsInit)
            {
                return;
            }

            float startTime = 0;

            if (m_bDisplayStats)
            {
                startTime = (float)m_pStopwatch.Elapsed.TotalMilliseconds;
            }

            CCDrawManager.PushMatrix();

            // draw the scene
            if (m_pRunningScene != null)
            {
                GraphIndex = 0;
                m_pRunningScene.Visit();
            }

            // draw the notifications node
            if (m_pNotificationNode != null)
            {
                NotificationNode.Visit();
            }

            if (m_bDisplayStats)
            {
                ShowStats();
            }

            CCDrawManager.PopMatrix();

            m_uTotalFrames++;

            if (m_bDisplayStats)
            {
                m_uDrawCount++;
                m_fAccumDraw += (float)m_pStopwatch.Elapsed.TotalMilliseconds - startTime;
            }
        }
Esempio n. 4
0
        protected void Draw(CCGameTime gameTime)
        {
            Stats.UpdateStart();

            DrawManager.PushMatrix();

            foreach (CCDirector director in sceneDirectors)
            {
                CCScene runningScene = director.RunningScene;

                // draw the scene
                if (runningScene != null)
                {
                    runningScene.Visit();
                    if (EventDispatcher.IsEventListenersFor(EVENT_AFTER_VISIT))
                    {
                        EventDispatcher.DispatchEvent(eventAfterVisit);
                    }
                }

                // draw the notifications node
                if (NotificationNode != null)
                {
                    NotificationNode.Visit();
                }

                if (EventDispatcher.IsEventListenersFor(EVENT_AFTER_DRAW))
                {
                    EventDispatcher.DispatchEvent(eventAfterDraw);
                }
            }

            DrawManager.PopMatrix();

            Stats.Draw(this);
        }