Chromium Code Reviews| 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 uint32_t connected; | |
| 25 | |
| 26 /** | |
| 27 * String identifier for the type of device/manufacturer. | |
| 28 */ | |
| 29 uint16_t[128] id; | |
|
brettw
2012/01/05 22:50:04
This is the same thing as uint16_t id[128], right?
scottmg
2012/01/06 00:54:21
Yes, it's just an array of ushorts. C-style doesn'
| |
| 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 axesLength; | |
|
brettw
2012/01/05 22:50:04
Google style would be axes_length (same for button
scottmg
2012/01/06 00:54:21
Done.
| |
| 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 buttonsLength; | |
| 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; | |
|
brettw
2012/01/05 22:50:04
In other places, we've just done "float" rather th
scottmg
2012/01/06 00:54:21
Yeah, that's what I did at first, but doesn't seem
| |
| 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 contains pointers to several | |
|
brettw
2012/01/05 22:50:04
This is wrong because you only provide a pointer t
scottmg
2012/01/06 00:54:21
Done. (I plead guilty to some copy-paste-o-rama)
| |
| 78 * functions for retrieving gamepad data. | |
| 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 |