Exemplo n.º 1
0
        protected void RenderFrameToDraw(Frame frameToDraw, bool endDraw)
        {
            try {
                if (frameToDraw != null)
                {
                    Manager.PrepareManager.AssertEmpty();
                    Manager.FlushBufferGenerators(frameToDraw.Index);
                    RenderFrame(frameToDraw, true);
                }

                if (endDraw)
                {
                    RunBeforePresentHandlers();
                    _SyncEndDraw();
                }

                FlushPendingDisposes();

                if (endDraw)
                {
                    RunAfterPresentHandlers();
                }
            } finally {
                if (frameToDraw != null)
                {
                    frameToDraw.Dispose();
                }
            }
        }
Exemplo n.º 2
0
        protected void RenderFrameToDraw(Frame frameToDraw, bool endDraw)
        {
            Squared.Threading.Profiling.Superluminal.BeginEventFormat("Issue Frame", "SRFrame #{0}", frameToDraw.Index, color: 0x10CFCF);
            try {
                PresentBegunSignal.Reset();

                if (frameToDraw != null)
                {
                    Manager.PrepareManager.AssertEmpty();
                    Manager.FlushBufferGenerators(frameToDraw.Index);
                    RenderFrame(frameToDraw, true);
                }

                if (endDraw)
                {
                    RunBeforePresentHandlers();
                    SetPresentBegun();
                    _SyncEndDraw();
                    SetPresentEnded();
                }

                if (endDraw)
                {
                    RunAfterPresentHandlers();
                }
            } finally {
                if (frameToDraw != null)
                {
                    frameToDraw.Dispose();
                }
                Squared.Threading.Profiling.Superluminal.EndEvent();
            }
        }
Exemplo n.º 3
0
        protected void RenderFrameToDraw(bool endDraw)
        {
            Manager.FlushBufferGenerators();

            var frameToDraw = Interlocked.Exchange(ref _FrameBeingDrawn, null);

            using (frameToDraw) {
                if (frameToDraw != null)
                {
                    RenderFrame(frameToDraw, true);
                }

                if (endDraw)
                {
                    _SyncEndDraw();
                }

                FlushPendingDisposes();
            }
        }