question about PVRShellGet(prefPointerLocation)

This topic contains 5 replies, has 3 voices, and was last updated by  amateurathlete 7 years, 7 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #30078

    Hi, this is probably a naive question: when I use PVRShellGet(prefPointerLocation) in the PC Emulation SDK I get the current mouse coordinates, even if the mouse just moves and no button is pressed. Since the pointer location is likely to correspond to a touch position on a mobile device, wouldn’t it make sense to report the pointer location only if a mouse button is pressed? Otherwise it is hard to emulate the ways users are interacting with a touch interface using a mouse (since touch events are less continuous than mouse movements).

    Just wondering.

    #33783

    Gordon
    Moderator

    This would make sense if you wanted to only emulate touch enabled platforms, but if developing for a platform with a mouse this would be limiting behaviour.

    Through PVRShellGet() it is also possible to get the button state (prefButtonState) – combining this with the pointer location should enable better emulation of touch events.

    #33784

    Yes, that works. (I’m only accepting new positions if 0 != PVRShellGet(prefButtonState); the result should always be -1 on the iPhone if I read the code correctly.)
    Thanks, Gordon.

    #33785

    Hello, there is a detail that I’m not quite getting. When I ask for PVRShellGet(prefPointerLocation), how do you get the individual x and y values?

    #33786

    Hi Bob!

    I’m not sure I understand your question. Are you looking for something like this?

        float *vec2PointerLocation;
        if (NULL != (vec2PointerLocation = (float *)PVRShellGet(prefPointerLocation)))
        {
            x = vec2PointerLocation[0];
            y = vec2PointerLocation[1];
            // …
        }

    #33787

    Perfect. Thanks.

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.