Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to allow CanvasAnimatedControl to skip waiting for V-Sync #968

Open
marcelwgn opened this issue Nov 11, 2024 · 0 comments
Open

Option to allow CanvasAnimatedControl to skip waiting for V-Sync #968

marcelwgn opened this issue Nov 11, 2024 · 0 comments

Comments

@marcelwgn
Copy link

marcelwgn commented Nov 11, 2024

When running in time critical rendering situations such as drag and drop, waiting for v-sync can result in stuttering/lagging behind. Unfortunately, with waiting for v-sync being the default for CanvasAnimatedControl, this makes these scenarios almost impossible to implement with a satisfying user experience.

Below a comparison between calling Present with a parameter larger than 1 and calling it with 0 being passed:

Video of mouse moving and visual lagging behind
Video of mouse moving and visual not lagging behind

Because of that, I would like to propose an option on CanvasAnimatedControl such that we can disable vsync and are able to use it in scenarios such as drag and drop. I would be more than happy to (help) implement this if this proposal gets approved.

Proposed API:

namespace Microsoft.Graphics.Canvas;

public sealed class CanvasAnimatedControl
{
  /// <summary>
  /// Determines the sync interval used by CanvasAnimatedControl. Defaults to 1. This parameter behaves exactly as the CanvasSwapChain.Present parameter. 
  /// See https://microsoft.github.io/Win2D/WinUI2/html/M_Microsoft_Graphics_Canvas_CanvasSwapChain_Present_1.htm for more context.
  /// </summary>  
  public int SyncInterval { get; set; } = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant