| OLD | NEW |
| (Empty) | |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. |
| 4 */ |
| 5 |
| 6 /** |
| 7 * This file defines the <code>PPB_Gamepad_Dev</code> interface, which |
| 8 * provides access to gamepad devices. |
| 9 */ |
| 10 |
| 11 label Chrome { |
| 12 M18 = 0.1 |
| 13 }; |
| 14 |
| 15 /** |
| 16 * The data for one gamepad device. |
| 17 */ |
| 18 [assert_size(472)] |
| 19 struct PP_GamepadData_Dev { |
| 20 /** |
| 21 * Is there a gamepad connected at this index? If this is false, no other |
| 22 * data in this structure is valid. |
| 23 */ |
| 24 char connected; |
| 25 |
| 26 /** |
| 27 * String identifier for the type of device/manufacturer. |
| 28 */ |
| 29 uint16_t[128] id; |
| 30 |
| 31 /** |
| 32 * Monotonically increasing value that is incremented when the data have |
| 33 * been updated. |
| 34 */ |
| 35 uint64_t timestamp; |
| 36 |
| 37 /** |
| 38 * Number of valid elements in the |axes| array. |
| 39 */ |
| 40 uint32_t axes_length; |
| 41 |
| 42 /** |
| 43 * Normalized values for the axes, indices valid up to |axesLength|-1. Axis |
| 44 * values range from -1..1, and are in order of "importance". |
| 45 */ |
| 46 float_t[16] axes; |
| 47 |
| 48 /** |
| 49 * Number of valid elements in the |buttons| array. |
| 50 */ |
| 51 uint32_t buttons_length; |
| 52 |
| 53 /** |
| 54 * Normalized values for the buttons, indices valid up to |buttonsLength| |
| 55 * - 1. Button values range from 0..1, and are in order of importance. |
| 56 */ |
| 57 float_t[32] buttons; |
| 58 }; |
| 59 |
| 60 /** |
| 61 * The data for all gamepads connected to the system. |
| 62 */ |
| 63 [assert_size(1896)] |
| 64 struct PP_GamepadsData_Dev { |
| 65 /** |
| 66 * Number of valid elements in the |items| array. |
| 67 */ |
| 68 uint32_t length; |
| 69 |
| 70 /** |
| 71 * Data for an individual gamepad device connected to the system. |
| 72 */ |
| 73 PP_GamepadData_Dev[4] items; |
| 74 }; |
| 75 |
| 76 /** |
| 77 * The <code>PPB_Gamepad_Dev</code> interface allows retrieving data from |
| 78 * gamepad/joystick devices that are connected to the system. |
| 79 */ |
| 80 [version=0.1, macro="PPB_GAMEPAD_DEV_INTERFACE"] |
| 81 interface PPB_Gamepad_Dev { |
| 82 /** |
| 83 * Samples the current state of the connected gamepads. |
| 84 */ |
| 85 void SampleGamepads( |
| 86 [in] PP_Instance instance, |
| 87 [out] PP_GamepadsData_Dev data); |
| 88 |
| 89 }; |
| OLD | NEW |