예제 #1
0
        static void ProcessMessageQueue(MessageFilterDelegate filter = null)
        {
            MyRenderProxy.AssertRenderThread();

            while (true)
            {
                bool          isPreFrame;
                MyUpdateFrame frame = SharedData.GetRenderFrame(out isPreFrame);
                if (frame == null)
                {
                    return;
                }

                MyRender.CurrentUpdateTime = frame.UpdateTimestamp;

                if (isPreFrame)
                {
                    MyRender.GetRenderProfiler().StartProfilingBlock("ProcessMessageQueue.ProcessPreFrame");
                    ProcessPreFrame(frame, filter);
                    MyRender.GetRenderProfiler().EndProfilingBlock();
                    SharedData.ReturnPreFrame(frame);
                }
                else
                {
                    MyRender.GetRenderProfiler().StartProfilingBlock("ProcessMessageQueue.ProcessRenderFrame");
                    ProcessRenderFrame(frame, filter);
                    MyRender.GetRenderProfiler().EndProfilingBlock();

                    MyRender.GetRenderProfiler().StartProfilingBlock("ProcessMessageQueue.MyRenderClipmap.UpdateQueued");
                    MyRenderClipmap.UpdateQueued();
                    MyRender.GetRenderProfiler().EndProfilingBlock();
                    return;
                }
            }
        }
예제 #2
0
        internal static void ProcessMessageQueue()
        {
            //MyRenderProxy.AssertRenderThread();

            bool ok = true;

            while (ok)
            {
                bool          isPreFrame;
                MyUpdateFrame frame = SharedData.GetRenderFrame(out isPreFrame);
                if (frame == null)
                {
                    return;
                }

                CurrentUpdateTime = frame.UpdateTimestamp;


                if (isPreFrame)
                {
                    MyRender11.GetRenderProfiler().StartProfilingBlock("ProcessPreFrame");

                    ProcessPreFrame(frame);

                    MyRender11.GetRenderProfiler().EndProfilingBlock();

                    SharedData.ReturnPreFrame(frame);
                }
                else
                {
                    MyRender11.GetRenderProfiler().StartProfilingBlock("ProcessRenderFrame");

                    ProcessRenderFrame(frame);

                    MyRender11.GetRenderProfiler().EndProfilingBlock();

                    MyRender11.GetRenderProfiler().StartProfilingBlock("MyClipmapHandler.UpdateQueued");

                    MyClipmapHandler.UpdateQueued();

                    MyRender11.GetRenderProfiler().EndProfilingBlock();

                    ok = false;
                }
            }
        }