You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WPF: What is the best way to achieve continuous rendering? #16
Thanks for this suggestion! I'm not very familiar with the pros and cons of using CompositionTarget.Rendering vs a timer for drawing graphics. A quick search advises timers are superior for limiting frame rate or implementing physics simulations where models should progress at a standard rate. This may favor the use of timers since many of the other projects on https://swharden.com/csdv/ (e.g., boids) would benefit from a constant speed.
EDIT: A more extensive search reveals some people recommend the opposite!
This discussion is worth including on the page though, so I'll create a new page comparing/contrasting these methods and link to it from all the relevant WPF pages.
changed the title [-][Suggestion] (projects\maui-graphics\QuickstartWpf)[/-][+]WPF: What is the best way to achieve continuous rendering?[/+]on Jun 24, 2022
Activity
swharden commentedon Jun 24, 2022
Hi @trmcnealy,
Thanks for this suggestion! I'm not very familiar with the pros and cons of using
CompositionTarget.Renderingvs a timer for drawing graphics. A quick search advises timers are superior for limiting frame rate or implementing physics simulations where models should progress at a standard rate. This may favor the use of timers since many of the other projects on https://swharden.com/csdv/ (e.g., boids) would benefit from a constant speed.EDIT: A more extensive search reveals some people recommend the opposite!
This discussion is worth including on the page though, so I'll create a new page comparing/contrasting these methods and link to it from all the relevant WPF pages.
Note that the web page being referenced is
which references project code that lives here:
Csharp-Data-Visualization/projects/maui-graphics/QuickstartWpf/MainWindow.xaml.cs
Lines 9 to 43 in 0c7683d
It sounds like
CompositionTarget.Renderingis an event that fires at the rate of vsync (usually 60 Hz) and this topic is discussed on several pages:[-][Suggestion] (projects\maui-graphics\QuickstartWpf)[/-][+]WPF: What is the best way to achieve continuous rendering?[/+]