private void Update() { var wasInvalidated = isInvalidated; isInvalidated = false; if (!form.Visible || !form.CanFocus || !renderControl.IsHandleCreated) { return; } UnclampedDelta = (float)stopwatch.Elapsed.TotalSeconds; float delta = Mathf.Clamp(UnclampedDelta, 0, Application.MaxDelta); stopwatch.Restart(); if (this == Application.MainWindow && Application.MainMenu != null) { Application.MainMenu.Refresh(); } fpsCounter.Refresh(); // Refresh mouse position of every frame to make HitTest work properly if mouse is outside of the screen. RefreshMousePosition(); if (active || Input.IsSimulationRunning) { Input.ProcessPendingInputEvents(delta); } if (Input.IsSimulationRunning) { Application.Input.Simulator.OnProcessingPendingInputEvents(); } RaiseUpdating(delta); AudioSystem.Update(); if (active || Input.IsSimulationRunning) { Input.CopyKeysState(); Input.TextInput = null; } if (wasInvalidated || renderingState == RenderingState.RenderDeferred) { renderControl.Invalidate(); } // We give one update cycle to handle files drop // (files dropped event may be fired inside update) if (Input.DroppedFiles.Count > 0 || shouldCleanDroppedFiles) { if (shouldCleanDroppedFiles) { Input.DroppedFiles.Clear(); } shouldCleanDroppedFiles = !shouldCleanDroppedFiles; } renderingState = renderControl.CanRender ? RenderingState.Updated : RenderingState.Rendered; WaitForRendering(); if (renderControl.CanRender) { RaiseSync(); if (AsyncRendering) { renderCompleted.Reset(); renderReady.Set(); } } }
public Sound Play(AudioChannelGroup group, bool paused, float fadeinTime = 0, bool looping = false, float priority = 0.5f, float volume = 1, float pan = 0, float pitch = 1) { return(AudioSystem.Play(Path, group, looping, priority, fadeinTime, paused, volume, pan, pitch)); }