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(); } } }
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(); } }
protected virtual void OnApplicationIdle() { inputPerformanceCollectionPeriod?.Dispose(); InputMonitor.NewFrame(); using (InputMonitor.BeginCollecting(PerformanceCollectionType.Scheduler)) InputScheduler.Update(); using (InputMonitor.BeginCollecting(PerformanceCollectionType.Sleep)) InputClock.ProcessFrame(); inputPerformanceCollectionPeriod = InputMonitor.BeginCollecting(PerformanceCollectionType.WndProc); }
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(); } }