DirectInput® 9.0 C. Shane Evans / Bernard George Program Manager DirectX Microsoft ® Corporation.

Slides:



Advertisements
Similar presentations
System Integration and Performance
Advertisements

1 Interaction Devices CIS 487/587 Bruce R. Maxim UM-Dearborn.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical.
MS-Access XP Lesson 1. Introduction to MS-Access Database Management System Software (DBMS) Store data in databases Database is a collection of table.
July 2010 D2.1 Upgrading strategy Javier Soto Catalog Release 3. Communities.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 10 Performance Tuning.
OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
1 Chapter 12 Working With Access 2000 on the Internet.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
User Interface Design: Methods of Interaction. Accepted design principles Interface design needs to consider the following issues: 1. Visual clarity 2.
Basic Input/Output Operations
1 of 4 To calibrate your digital pen click the Start ( ) button>Control Panel>Mobile PC>Calibrate the screen. On the General tab, tap Calibrate, and then.
Graphical User Interface (GUI) Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Hands-On Microsoft Windows Server 2003 Networking Chapter 7 Windows Internet Naming Service.
MCITP Guide to Microsoft Windows Server 2008 Server Administration (Exam #70-646) Chapter 14 Server and Network Monitoring.
With Microsoft Access 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access.
1 of 3 Using digital ink, the Microsoft® Tablet PC offers the full power and functionality of a notebook PC with the added benefits of pen-based computing.
Hands-On Microsoft Windows Server 2008 Chapter 11 Server and Network Monitoring.
Windows Server 2008 Chapter 11 Last Update
Chapter 8: String Manipulation
GOODWILL OF NORTHWEST NORTH CAROLINA, INC. EMPLOYEE TRAINING DATABASE PROTOTYPE.
© 1999, by Que Education and Training, Chapter 5, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
MySQL in PHP – Page 1 of 17CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: MySQL in PHP Reading: Williams &
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
MCTS Guide to Microsoft Windows 7
An Introduction to Silverlight Matt Harrington Developer Evangelist, Microsoft October 20, 2011.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Execution Environment for JavaScript " Java Script Window object represents the window in which the browser displays documents. " The Window object provides.
ASP.NET Web Server Controls Basic Web Server Controls.
Multi-Part Requests/ Parent & Child Service Items.
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
Arden Objects Proposal Arden SIG Meeting Jan. 14, 2003 San Antonio, Texas Presented by Roger Corman.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
CSE3AGT Paul Taylor Stupid Conventions! l = Long p = Pointer h = handle g = global wnd = Windows WM = Windows Message d3d = Direct3D hr = HRESULT.
CHAPTER 5 Input Control © 2008 Cengage Learning EMEA.
Visual Basic Programming Chapter Six Notes Repetition and the Do Statement ADDING ICONS TO YOUR FORM –It is possible to add an ______________ to your title.
SESSION 3.1 This section covers using the query window in design view to create a query and sorting & filtering data while in a datasheet view. Microsoft.
Term 2, 2011 Week 1. CONTENTS Problem-solving methodology Programming and scripting languages – Programming languages Programming languages – Scripting.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Data TypestMyn1 Data Types The type of a variable is not set by the programmer; rather, it is decided at runtime by PHP depending on the context in which.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
S6-1 ADM703, Section 6, August 2005 Copyright  2005 MSC.Software Corporation SECTION 6 OVER-RUNNING PULLEY.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
1.
Object Oriented Database By Ashish Kaul References from Professor Lee’s presentations and the Web.
Program 2 due 02/01  Be sure to document your program  program level doc  your name  what the program does  each function  describe the arguments.
1 © 2012 John Urrutia. All rights reserved. Chapter 6 The vi Editor.
Jini Architecture Introduction System Overview An Example.
Haptic & Direct User Input with DirectInput ® 8 API Graphics Lab. Korea Univ.
GAM666 – Introduction To Game Programming ● DirectInput is the part of DirectX for managing input devices, such as keyboard, mouse and joystick ● Supports.
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
11 Using the Keyboard in XNA Session 9.1. Session Overview  Discover more detail on how the XNA keyboard is implemented  Find out how to use arrays.
Fab25 User Training Cerium Labs LabCollector - LIMS Lynette Ballast.
Wednesday NI Vision Sessions
How to develop a VoIP softphone in C# that enables SIP Instant Messaging (IM) This presentation describes how to create a softphone in C# that allows you.
How to develop a VoIP softphone in C# by using OZEKI VoIP SIP SDK This presentation demonstrates the first steps concerning to how to develop a fully-functional.
CHAPTER 5 Input Control © 2008 Cengage Learning EMEA.
Lecture 12: Data Wrangling
Web Development Using ASP .NET
Microsoft Access Validation Rules, Table Relationships And
Next Gen GUI Concept Aaron Cardenas, 21/10/2008.
Shane B., Esther K., Curtis S., Jennifer W.
Presentation transcript:

DirectInput® 9.0 C. Shane Evans / Bernard George Program Manager DirectX Microsoft ® Corporation

Agenda Mission: Usability Mission: Usability New Features New Features Improvements Improvements Whats Next? Whats Next?

New Features Frame-based Input Frame-based Input Keyboard Text Keyboard Text New Device Enumeration Model New Device Enumeration Model New Device Object Enumeration Model New Device Object Enumeration Model Device Plug/Unplug Notifications Device Plug/Unplug Notifications Modern Device Support Modern Device Support

Frame-based Input Motivation Motivation State tracking of buttons and axes are common to the most games State tracking of buttons and axes are common to the most games Games are inherently frame-based Games are inherently frame-based Why isnt DirectInput also frame-based? Why isnt DirectInput also frame-based? Advantages Advantages Application does not need to parse buffered data Application does not need to parse buffered data Objects current states are reported Objects current states are reported Developers wont complain (as much)! Developers wont complain (as much)!

Frame-based Input Application can query DirectInput for events since the last frame Application can query DirectInput for events since the last frame Data reported in each frame is tailored to particular controls on a device Data reported in each frame is tailored to particular controls on a device Buttons Buttons Relative Axes Relative Axes Absolute Axes/POVs Absolute Axes/POVs

Frame-based Input Buttons Four states to summarize the state of a button Four states to summarize the state of a button Inactive Inactive Active Active Still Active Still Active Changed/Still Active Changed/Still Active

Frame-based Input Relative Axes Multiple axis events may occur between frames Multiple axis events may occur between frames Actual input is Actual input is To smooth these axes events, DirectInput reports their average To smooth these axes events, DirectInput reports their average Application receives Application receives

Frame-based Input Absolute Axes/POVs DirectInput simply reports the current position of absolute axes DirectInput simply reports the current position of absolute axes POVs are reported with the current single position (still as angle from N). POVs are reported with the current single position (still as angle from N). Single report is given because thats what games use. Single report is given because thats what games use.

Frame-based Input Common Data The following detailed data is provided for all types of controls for each frame The following detailed data is provided for all types of controls for each frame dwCurrent dwCurrent Current value of the control dwStart dwStart Value at beginning of frame dwMin dwMin Minimum value at during frame dwMax dwMax Maximum value at during frame

Keyboard Text Motivation Motivation Constructing strings by treating keys as objects and retrieving DIPROP_KEYNAME can be cumbersome Constructing strings by treating keys as objects and retrieving DIPROP_KEYNAME can be cumbersome Declare a DIPROPSTRING variable Declare a DIPROPSTRING variable Determine ID of key that is pressed Determine ID of key that is pressed Call IDirectInputDevice8::GetProperty to recover the string Call IDirectInputDevice8::GetProperty to recover the string Can be slow as well, since the a keys text is looked up on the fly Can be slow as well, since the a keys text is looked up on the fly

Keyboard Text Application can enable new text input with IDirectInput9::EnableKBText Application can enable new text input with IDirectInput9::EnableKBText An internal lookup table for keys is created An internal lookup table for keys is created Key lookups are much faster Key lookups are much faster Application must keep track of the state of the shift key Application must keep track of the state of the shift key Call IDirectInput9::GetKeyText with the keys object ID and shift status to recover a keys text Call IDirectInput9::GetKeyText with the keys object ID and shift status to recover a keys text

New Device Enumeration Model Motivation Motivation General shift toward pull model in DirectX ® General shift toward pull model in DirectX ® Callback functions can be complicated Callback functions can be complicated Advantages Advantages Developer has more control Developer has more control Simpler! Simpler!

New Device Enumeration Model Application can call IDirectInput9::GetDeviceCount to retrieve the number of devices on the system Application can call IDirectInput9::GetDeviceCount to retrieve the number of devices on the system Flags can optionally be passed to indicate that only subset of available devices should be enumerated Flags can optionally be passed to indicate that only subset of available devices should be enumerated Each device is internally assigned an index between 0 and the number of pertinent devices – 1 inclusive Each device is internally assigned an index between 0 and the number of pertinent devices – 1 inclusive

New Device Enumeration Model Devices are now addressed by index Devices are now addressed by index IDirectInput9::CheckDevice can test a devices capabilities IDirectInput9::CheckDevice can test a devices capabilities Force feedback Force feedback Action mapping Action mapping

New Device Enumeration Model As before, devices are created by calling CreateDevice method As before, devices are created by calling CreateDevice method Accepts device index Accepts device index Sets a pointer to an IDirectInputDevice9 interface Sets a pointer to an IDirectInputDevice9 interface Dont need to set co-op level! Dont need to set co-op level! Otherwise IDirectInput9 can be used as you would expect Otherwise IDirectInput9 can be used as you would expect

New Device Object Enumeration Model Pull model as with device enumeration Pull model as with device enumeration Application can call IDirectInputDevice9::GetObjectCount to retrieve the number of objects on a device Application can call IDirectInputDevice9::GetObjectCount to retrieve the number of objects on a device Flags can optionally be passed to indicate that only subset of available objects should be enumerated Flags can optionally be passed to indicate that only subset of available objects should be enumerated Each object is internally assigned an index between 0 and the number of pertinent objects – 1 inclusive Each object is internally assigned an index between 0 and the number of pertinent objects – 1 inclusive

New Device Object Enumeration Model Each object can now be referenced by its index Each object can now be referenced by its index Calling IDirectInputDevice9::GetObject retrieves a DIDEVICEOBJECTINSTANCE structure Calling IDirectInputDevice9::GetObject retrieves a DIDEVICEOBJECTINSTANCE structure dwOfsNative member added to DIDEVICEOBJECTINSTANCE dwOfsNative member added to DIDEVICEOBJECTINSTANCE

Plug/Unplug Notifications Applications can request to be notified when a device is plugged in or unplugged Applications can request to be notified when a device is plugged in or unplugged Call RegisterWindowMessage with DIRECTINPUT_NOTIFICATION_DEVICEPLUG message string (dinput.h) Call RegisterWindowMessage with DIRECTINPUT_NOTIFICATION_DEVICEPLUG message string (dinput.h)

Plug/Unplug Notifications When a DIRECTINPUT_NOTIFICATION_DEVICE PLUG message is received When a DIRECTINPUT_NOTIFICATION_DEVICE PLUG message is received wParam is the devices index wParam is the devices index lParam indicates the devices status lParam indicates the devices status 0 value means the device is now unplugged 0 value means the device is now unplugged Nonzero means the device is now plugged in Nonzero means the device is now plugged in

Plug/Unplug Notifications If a device is new to an application If a device is new to an application wParam is 0xFFFFFFFF wParam is 0xFFFFFFFF lParam is nonzero (plugged) lParam is nonzero (plugged) The device can be created by calling CreateDevice with the index previously returned by GetDeviceCount + 1 The device can be created by calling CreateDevice with the index previously returned by GetDeviceCount + 1

Modern Device Support Support for new controls on todays complex devices Support for new controls on todays complex devices Proportional Buttons Proportional Buttons Independent Axis Sets Independent Axis Sets

Modern Device Support Proportional Buttons Proportional Buttons dwButtonData member added to DIDEVICEOBJECTDATA to represent degree to which button is pressed dwButtonData member added to DIDEVICEOBJECTDATA to represent degree to which button is pressed Can also behave like standard buttons Can also behave like standard buttons If button pressed past threshold, it is active If button pressed past threshold, it is active Threshold implemented in property DIPROP_BUTTONTHRESHOLD Threshold implemented in property DIPROP_BUTTONTHRESHOLD IDirectInput::Get/SetButtonThreshold can manipulate threshold IDirectInput::Get/SetButtonThreshold can manipulate threshold Default is 10% of range Default is 10% of range

Modern Device Support Independent Axis Sets Independent Axis Sets Mainly a hardware thing. Games should see better mappings from DirectInput. Mainly a hardware thing. Games should see better mappings from DirectInput. Simple way of organizing axes on a device Simple way of organizing axes on a device Sets of axes are assigned ordinals Sets of axes are assigned ordinals Ordinals differentiate between multiple, say, X - axes Ordinals differentiate between multiple, say, X - axes

Improvements Joystick Control Panel Joystick Control Panel Default Cooperative Level Default Cooperative Level Simpler Device Properties Simpler Device Properties

Joystick Control Panel Test page Test page Device image added Device image added Historically confusing Apply button removed Historically confusing Apply button removed

Joystick Control Panel Settings Page Settings Page Racing Wheels pedal mode configuration for legacy games Racing Wheels pedal mode configuration for legacy games Historically confusing Apply button removed Historically confusing Apply button removed

Joystick Control Panel Calibration Calibration Better use of space in calibration wizard Better use of space in calibration wizard Additional racing wheel-specific calibration Additional racing wheel-specific calibration New steering wheel position indicator New steering wheel position indicator Accelerator/Brake discovery and calibration Accelerator/Brake discovery and calibration

Joystick Control Panel

Default Cooperative Level Cooperative level need not be explicitly set Cooperative level need not be explicitly set Default cooperative level set during device creation Default cooperative level set during device creation Similar to DISCL_FOREGROUND | DISCL_NONEXCLUSIVE with added benefits Similar to DISCL_FOREGROUND | DISCL_NONEXCLUSIVE with added benefits Works for Force Feedback devices Works for Force Feedback devices

Default Cooperative Level Devices do not need to be explicitly reacquired Devices do not need to be explicitly reacquired Use DISCL_FOCUSACQUIRE in IDirectInputDevice9:: SetCooperativeLevel Use DISCL_FOCUSACQUIRE in IDirectInputDevice9:: SetCooperativeLevel Automatic acquisition when application gains focus Automatic acquisition when application gains focus Only valid with foreground cooperative levels Only valid with foreground cooperative levels

Simpler Device Properties Separate methods to set each property rather than just IDirectInputDevice8::Get/SetProperty Separate methods to set each property rather than just IDirectInputDevice8::Get/SetProperty MUCH simpler than before MUCH simpler than before

Simpler Device Properties DirectInput 8.0 Example For example, the following code is needed to set the range of the X-axis with DirectInput 8.0 For example, the following code is needed to set the range of the X-axis with DirectInput 8.0 // DirectX 8.0 code for changing a // property DIPROPRANGE diprg; ZeroMemory(&diprg, sizeof(diprg)); diprg.diph.dwObj = DIJOFS_X; diprg.lMin = -1000; diprg.lMax = +1000; err = pDIDev->SetProperty(DIPROP_RANGE, &diprg.diph);

Simpler Device Properties DirectInput 9.0 Example The same task can now be done with the following code The same task can now be done with the following code // Equivalent DirectX 9.0 code err = pDIDev->SetAxisRange(AXIS_X, -1000, +1000);

Device Image Display Object SDK sample code that performs simple device image rendering tasks SDK sample code that performs simple device image rendering tasks Very easy to incorporate device images into your game Very easy to incorporate device images into your game Exposes simple methods to perform common but often code-intensive tasks Exposes simple methods to perform common but often code-intensive tasks Display device Display device Change view Change view Show callout, display text Show callout, display text Highlight callout Highlight callout

DirectInput® 9.0 Questions? Contact: