Reader small image

You're reading from  Leap Motion Development Essentials

Product typeBook
Published inOct 2013
PublisherPackt
ISBN-139781849697729
Edition1st Edition
Right arrow
Author (1)
Mischa Spiegelmock
Mischa Spiegelmock
author image
Mischa Spiegelmock

Mischa Spiegelmock is an accomplished software engineer from the San Francisco Bay Area. Slightly infamous from light-hearted technical pranks from his youth, he is now a respectable CTO at a healthcare software startup. His passions are architecting elegant and useful programs and sharing his insights into software design with others in a straightforward and entertaining fashion.
Read more about Mischa Spiegelmock

Right arrow

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 move and resize the selected window when we receive the appropriate hand motions.

Firstly, we need a simple and intuitive interface for our user to indicate where they would like the window to sit in the virtual...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Leap Motion Development Essentials
Published in: Oct 2013Publisher: PacktISBN-13: 9781849697729

Author (1)

author image
Mischa Spiegelmock

Mischa Spiegelmock is an accomplished software engineer from the San Francisco Bay Area. Slightly infamous from light-hearted technical pranks from his youth, he is now a respectable CTO at a healthcare software startup. His passions are architecting elegant and useful programs and sharing his insights into software design with others in a straightforward and entertaining fashion.
Read more about Mischa Spiegelmock