internal Frame BeginFrame(bool flushPendingDraws)
        {
            if (flushPendingDraws)
            {
                RunPendingDraws();
            }
            SynchronousDrawsEnabled = false;
            var frame = _FrameBeingPrepared = Manager.CreateFrame(this);

            return(_FrameBeingPrepared);
        }
Example #2
0
        public bool BeginDraw()
        {
            WaitForActiveSynchronousDraw();
            WaitForActiveDraw();

            if (Interlocked.Exchange(ref _DrawIsActive, 1) != 0)
            {
                return(false);
            }

            _ActualEnableThreading = EnableThreading;

            bool result;

            if (_Running)
            {
                _FrameBeingPrepared = Manager.CreateFrame();

                if (DoThreadedIssue)
                {
                    result = true;
                }
                else
                {
                    result = _SyncBeginDraw();
                }
            }
            else
            {
                result = false;
            }

            if (!result)
            {
                Interlocked.Exchange(ref _DrawIsActive, 0);
            }

            return(result);
        }
 public Frame BeginFrame()
 {
     return(_FrameBeingPrepared = Manager.CreateFrame());
 }