Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Leap Motion Development Essentials

You're reading from  Leap Motion Development Essentials

Product type Book
Published in Oct 2013
Publisher Packt
ISBN-13 9781849697729
Pages 106 pages
Edition 1st Edition
Languages
Author (1):
Mischa Spiegelmock Mischa Spiegelmock
Profile icon Mischa Spiegelmock

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 chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}