コード例 #1
0
        private void updateLoop()
        {
            //this was added due to the dependency on GLWrapper.MaxTextureSize begin initialised.
            while (!GLWrapper.IsInitialized)
            {
                Thread.Sleep(1);
            }

            while (!ExitRequested)
            {
                UpdateMonitor.NewFrame();

                using (UpdateMonitor.BeginCollecting(PerformanceCollectionType.Scheduler))
                {
                    UpdateScheduler.Update();
                }

                using (UpdateMonitor.BeginCollecting(PerformanceCollectionType.Update))
                {
                    UpdateSubTree();
                    using (var buffer = DrawRoots.Get(UsageType.Write))
                        buffer.Object = GenerateDrawNodeSubtree(buffer.Object);
                }

                using (UpdateMonitor.BeginCollecting(PerformanceCollectionType.Sleep))
                {
                    UpdateClock.ProcessFrame();
                }
            }
        }
コード例 #2
0
        private void drawLoop()
        {
            GLControl.Initialize();
            GLWrapper.Initialize();

            while (!exitRequested)
            {
                DrawMonitor.NewFrame(DrawClock);

                using (DrawMonitor.BeginCollecting(PerformanceCollectionType.Draw))
                {
                    GLWrapper.Reset(Size);
                    GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
                    pendingRootNode?.DrawSubTree();
                }

                using (DrawMonitor.BeginCollecting(PerformanceCollectionType.SwapBuffer))
                {
                    GLControl.SwapBuffers();
                    GLControl.Invalidate();
                }

                using (DrawMonitor.BeginCollecting(PerformanceCollectionType.Sleep))
                    DrawClock.ProcessFrame();
            }
        }
コード例 #3
0
        protected override void Update()
        {
            clock.ProcessFrame();
            Scheduler.Update();
            Audio.Update();

            base.Update();
        }
コード例 #4
0
        private void drawLoop()
        {
            GLControl?.Initialize();
            GLWrapper.Initialize();

            while (!ExitRequested)
            {
                DrawMonitor.NewFrame();

                DrawFrame();

                using (DrawMonitor.BeginCollecting(PerformanceCollectionType.SwapBuffer))
                    GLControl?.SwapBuffers();

                using (DrawMonitor.BeginCollecting(PerformanceCollectionType.Sleep))
                    DrawClock.ProcessFrame();
            }
        }