From 82960e50af41b32e6ecb49d5a1006dab087050ec Mon Sep 17 00:00:00 2001 From: Rene Damm Date: Mon, 23 Oct 2017 23:37:50 -0700 Subject: [PATCH] Updated Technical Notes (markdown) --- Technical-Notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Technical-Notes.md b/Technical-Notes.md index f726f34..8641ec6 100644 --- a/Technical-Notes.md +++ b/Technical-Notes.md @@ -2,7 +2,7 @@ This page is for collecting notes on specific technical issues. # Delta Controls -Delta controls (like e.g. mouse motion deltas) turn out to be unexpectedly tricky beasts. The two unusual aspects about them is that a) they want to *accumulate* (if the app gets send two mouse deltas from the system and they end up in the same input update, you want them to add up and not just see only the second delta) and b) they want to reset back to zero between input updates. Since mice are usually sampled at higher frequencies than GFX refreshes and since deltas are commonly used to drive sensitive things such as mouse look, handling this correctly actually matters. +Delta controls (like e.g. mouse motion deltas) turn out to be unexpectedly tricky beasts. The two unusual aspects about them is that a) they want to *accumulate* (if the app gets sent two mouse deltas from the system and they end up in the same input update, you want them to add up and not just see only the second delta) and b) they want to reset back to zero between input updates. Since mice are usually sampled at higher frequencies than GFX refreshes and since deltas are commonly used to drive sensitive things such as mouse look, handling this correctly actually matters. My first thought was: let's not complicate the state system and deal with the problem in the code that generates mouse state events (i.e. the platform layer). However, this turns out to be surprisingly tricky to implement correctly. The problem is that knowing when to accumulate and when to reset is intricately tied to which mouse state events go into which input updates -- something that is hard for the OS layer to know. Simply accumulating during a frame and resetting between frames will lead to correct behavior for dynamic updates (which span an entire frame) but will not lead to correct behavior for other update types.