Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Windows 8 Game Development

You're reading from   Learning Windows 8 Game Development Windows 8 brings touchscreens to the tablet and PC. This book will show you how to develop games for both by following clear, hands-on examples. Takes your C++ skills into exciting areas of 3D development.

Arrow left icon
Product type Paperback
Published in Oct 2013
Publisher Packt
ISBN-13 9781849697446
Length 244 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Michael Quandt Michael Quandt
Author Profile Icon Michael Quandt
Michael Quandt
Arrow right icon
View More author details
Toc

Pointers

Touch screens are defining the current generation of devices, and to make supporting these devices easier we have a new API that combines touch, mouse, and pen input into the Pointer API. This API abstracts the type of the device away so that you can focus on the common aspect between the three different devices, the actual pointer. Unless you need built-in gestures, using the Pointer API is your best option to cover both the mouse and touch screen in one go.

The pointer events provided by Windows are exposed through the CoreWindow object that we have in our GameApplication class (this inherits from the IFrameworkView); you'll see two of them there already: OnPointerPressed and OnPointerMoved. Let's add one more to support all of the main interactions you can have using a pointer device: OnPointerReleased.

Add the following private prototype to the GameApplication.h:

void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args)...
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 AU $24.99/month. Cancel anytime