Example #1
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();
            }
        }