O'Reilly logo

Leap Motion Development Essentials by Mischa Spiegelmock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Window management abstraction

At this point in the program we now know that the user performed a tap and we know exactly which screen coordinates they were pointing at when tapping. What we want to do now is to see if a window is positioned at the screen coordinates of the pointable ray intersection. Our driver will take care of the platform-specific details.

        flingerWinRef win = driver->getWindowAt(screenLoc.x, screenLoc.y);
        if (win == NULL)
            continue;

        currentWin = win;

The job of getWindowAt(x, y) is to query the window manager and determine if the point falls within the bounds of any windows onscreen, and if so, which window is frontmost. If a window is located, an opaque reference to it is returned and we can stash it away later, in order to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required