sgonchar
Topic Author
Posts: 33
Joined: 15 Mar 2021, 22:11

Re: Scrolling ScrollViewer with RStick when not in focus

15 Jul 2021, 20:51

Hello,
The above spawned quite a bit of a conversation on our end .. we aren't convinced a frame limiter is strictly needed, or at least in render loop.

Here are some thoughts, I'd love to know what you think.

Currently the scroll value gets lost between these 3 functions at very high FPS:
bool View::Scroll(float value) // value is some value at any FPS
{
    VerifyAccess();

    return mMouse->Scroll(value * mCurrentDeltaTime * 10.0f); 
}
// ...
bool Mouse::Scroll(float value)
{
    Ptr<UIElement> element(mView->GetKeyboard()->GetFocused());
    return RaiseWheel(element, int(value * WheelDelta()), Orientation_Vertical);
}
// ...
bool Mouse::RaiseWheel(UIElement* element, int rotation, Orientation orientation)  // rotation = 0 for high FPS
{
    ...
}
We are wondering if:
- It's possible to get View::Scroll and Mouse::Scroll not to lose tiny values at high FPS?

- Would Win32Display::EnterMessageLoop need to be modified to run at certain FPS?

- We are worried about dropped frames loosing input, do buttons/Rstick/etc input get cached till next fetch? or can one (ay at 5fps) press button fast enough that up/down event happens within single update and get lost?
-- From Win32Display looks like most buttons done via messages but RStick/LT/RT is a fetch from state_.Gamepad.wButtons .. which I'm not can catch fast button events at low fps, does it?
-- Edit1 Can confirm that none of the inputs get lost during dropped frames, dpad/facebuttons/and RStick all process input fine.
 
User avatar
jsantos
Site Admin
Posts: 3139
Joined: 20 Jan 2012, 17:18
Contact:

Re: Scrolling ScrollViewer with RStick when not in focus

16 Jul 2021, 11:38

The above spawned quite a bit of a conversation on our end .. we aren't convinced a frame limiter is strictly needed, or at least in render loop.
I think you need to limit this someway. If you don't do that you are going to waste a lot of cycles doing thousands of UpdateRenderTree() per vsync. This is something we want to improve in our application-framework for all platforms. Right now Android (using the Choreographer) and iOS (using CADisplayLink) are synchronizing with the display. For Windows we have DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT (we are still not using it) and for the rest of platforms I assume this will need to be emulated by using some kind of timer.

Once we solve this for all platforms we will start using the boolean returned by UpdateRenderTree() to skip rendering.
 
sgonchar
Topic Author
Posts: 33
Joined: 15 Mar 2021, 22:11

Re: Scrolling ScrollViewer with RStick when not in focus

16 Jul 2021, 18:02

Ok, thank you! That makes sense.

Who is online

Users browsing this forum: No registered users and 1 guest