protected virtual void DrawFrame() { using (DrawMonitor.BeginCollecting(PerformanceCollectionType.GLReset)) { GLWrapper.Reset(DrawSize); GLWrapper.ClearColour(Color4.Black); } while (true) { using (var buffer = DrawRoots.Get(UsageType.Read)) { if (buffer?.Object != null && buffer.FrameId != lastDrawFrameId) { buffer.Object.Draw(null); lastDrawFrameId = buffer.FrameId; break; } } Thread.Sleep(1); } GLWrapper.FlushCurrentBatch(); using (DrawMonitor.BeginCollecting(PerformanceCollectionType.SwapBuffer)) Window.SwapBuffers(); }
protected virtual void DrawFrame() { using (DrawMonitor.BeginCollecting(PerformanceCollectionType.GLReset)) { GLWrapper.Reset(DrawSize); GLWrapper.ClearColour(Color4.Black); } using (var buffer = DrawRoots.Get(UsageType.Read)) buffer?.Object?.Draw(null); GLWrapper.FlushCurrentBatch(); using (DrawMonitor.BeginCollecting(PerformanceCollectionType.SwapBuffer)) Window.SwapBuffers(); }