BeginDraw() public méthode

public BeginDraw ( ) : bool
Résultat bool
Exemple #1
0
        protected override bool BeginDraw()
        {
            RenderCoordinator.WorkStopwatch.Restart();

            ThreadGroup.TryStepMainThreadUntilDrained();

            var settling = RenderCoordinator.IsWaitingForDeviceToSettle;

            try {
                var ok = IsContentLoaded && !settling && RenderCoordinator.BeginDraw();
                if (!ok)
                {
                    if (BeginDrawFailed != null)
                    {
                        BeginDrawFailed();
                    }
                    else if (!settling)
                    {
                        Console.Error.WriteLine("BeginDraw failed");
                    }
                }
                return(ok);
            } finally {
                RenderCoordinator.WorkStopwatch.Stop();
                NextFrameTiming.BeginDraw = RenderCoordinator.WorkStopwatch.Elapsed;
            }
        }
        protected override bool BeginDraw()
        {
            RenderCoordinator.WorkStopwatch.Restart();

            try {
                return(RenderCoordinator.BeginDraw());
            } finally {
                RenderCoordinator.WorkStopwatch.Stop();
                NextFrameTiming.BeginDraw = RenderCoordinator.WorkStopwatch.Elapsed;
            }
        }