public void Present() { // Dispose of any GL resources that were disposed in another thread lock (disposeActionsLock) { if (disposeActions.Count > 0) { foreach (Action action in disposeActions) { action(); } disposeActions.Clear(); } } GLDevice.SwapBuffers(PresentationParameters.DeviceWindowHandle); }