Ejemplo n.º 1
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();
            }
        }
Ejemplo n.º 2
0
        void Draw()
        {
            DrawManager.BeginDraw();

            CCScene runningScene = Director.RunningScene;

            var vp = Viewport;

            if (runningScene != null)
            {
                try {
                    Renderer.PushViewportGroup(ref vp);

                    runningScene.Visit();

                    Renderer.PopViewportGroup();

                    Renderer.VisitRenderQueue();
                }
                catch (Exception e)
                {
                    LogMessage("CCGameView: " + e.Message);
                }
            }

            if (Stats.Enabled)
            {
                try {
                    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();
                }
                catch (Exception e) {
                    string msg = new System.Text.StringBuilder()
                                 .AppendLine($"Draw.Stats.Enabled : {e.Message}")
                                 .AppendLine($"Stack Trace: {e.StackTrace}")
                                 .ToString();

                    LogMessage(msg);
                }
            }

            DrawManager.EndDraw();
        }
Ejemplo n.º 3
0
        void Draw()
        {
            DrawManager.BeginDraw();

            CCScene runningScene = Director.RunningScene;

            var vp = Viewport;

            if (runningScene != null)
            {
                Renderer.PushViewportGroup(ref vp);

                runningScene.Visit();

                Renderer.PopViewportGroup();

                Renderer.VisitRenderQueue();
            }

            if (Stats.Enabled)
            {
                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();
            }

            DrawManager.EndDraw();
        }
Ejemplo 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);
        }