Pepper_47_C_interfaces
Main Page
Modules
Classes
Files
File List
File Members
ppb_gamepad.h
Go to the documentation of this file.
1
/* Copyright (c) 2012 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
/* From ppb_gamepad.idl modified Thu Oct 20 13:57:04 2016. */
7
8
#ifndef PPAPI_C_PPB_GAMEPAD_H_
9
#define PPAPI_C_PPB_GAMEPAD_H_
10
11
#include "
ppapi/c/pp_bool.h
"
12
#include "
ppapi/c/pp_instance.h
"
13
#include "
ppapi/c/pp_macros.h
"
14
#include "
ppapi/c/pp_stdint.h
"
15
16
#define PPB_GAMEPAD_INTERFACE_1_0 "PPB_Gamepad;1.0"
17
#define PPB_GAMEPAD_INTERFACE PPB_GAMEPAD_INTERFACE_1_0
18
19
/**
20
* @file
21
* This file defines the <code>PPB_Gamepad</code> interface, which
22
* provides access to gamepad devices.
23
*/
24
25
26
/**
27
* @addtogroup Structs
28
* @{
29
*/
30
/**
31
* The data for one gamepad device.
32
*/
33
struct
PP_GamepadSampleData
{
34
/**
35
* Number of valid elements in the |axes| array.
36
*/
37
uint32_t
axes_length
;
38
/**
39
* Normalized values for the axes, indices valid up to |axes_length|-1. Axis
40
* values range from -1..1, and are in order of "importance".
41
*/
42
float
axes
[16];
43
/**
44
* Number of valid elements in the |buttons| array.
45
*/
46
uint32_t
buttons_length
;
47
/**
48
* Normalized values for the buttons, indices valid up to |buttons_length|
49
* - 1. Button values range from 0..1, and are in order of importance.
50
*/
51
float
buttons
[32];
52
/**
53
* Monotonically increasing value that is incremented when the data have
54
* been updated.
55
*/
56
double
timestamp
;
57
/**
58
* Identifier for the type of device/manufacturer.
59
*/
60
uint16_t
id
[128];
61
/**
62
* Is there a gamepad connected at this index? If this is false, no other
63
* data in this structure is valid.
64
*/
65
PP_Bool
connected
;
66
/* Padding to make the struct the same size between 64 and 32. */
67
char
unused_pad_
[4];
68
};
69
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES
(
PP_GamepadSampleData
, 472);
70
71
/**
72
* The data for all gamepads connected to the system.
73
*/
74
struct
PP_GamepadsSampleData
{
75
/**
76
* Number of valid elements in the |items| array.
77
*/
78
uint32_t
length
;
79
/* Padding to make the struct the same size between 64 and 32. */
80
char
unused_pad_
[4];
81
/**
82
* Data for an individual gamepad device connected to the system.
83
*/
84
struct
PP_GamepadSampleData
items
[4];
85
};
86
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES
(
PP_GamepadsSampleData
, 1896);
87
/**
88
* @}
89
*/
90
91
/**
92
* @addtogroup Interfaces
93
* @{
94
*/
95
/**
96
* The <code>PPB_Gamepad</code> interface allows retrieving data from
97
* gamepad/joystick devices that are connected to the system.
98
*/
99
struct
PPB_Gamepad_1_0
{
100
/**
101
* Samples the current state of the available gamepads.
102
*/
103
void (*
Sample
)(
PP_Instance
instance,
struct
PP_GamepadsSampleData
* data);
104
};
105
106
typedef
struct
PPB_Gamepad_1_0
PPB_Gamepad
;
107
/**
108
* @}
109
*/
110
111
#endif
/* PPAPI_C_PPB_GAMEPAD_H_ */
112
pp_macros.h
PP_GamepadSampleData::unused_pad_
char unused_pad_[4]
Definition:
ppb_gamepad.h:67
PP_GamepadSampleData::axes
float axes[16]
Definition:
ppb_gamepad.h:42
PP_GamepadsSampleData::length
uint32_t length
Definition:
ppb_gamepad.h:78
PP_GamepadSampleData::timestamp
double timestamp
Definition:
ppb_gamepad.h:56
pp_bool.h
pp_instance.h
PP_GamepadSampleData::buttons_length
uint32_t buttons_length
Definition:
ppb_gamepad.h:46
PPB_Gamepad_1_0
Definition:
ppb_gamepad.h:99
PP_GamepadSampleData::buttons
float buttons[32]
Definition:
ppb_gamepad.h:51
PP_GamepadsSampleData::unused_pad_
char unused_pad_[4]
Definition:
ppb_gamepad.h:80
PP_GamepadSampleData::axes_length
uint32_t axes_length
Definition:
ppb_gamepad.h:37
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_GamepadSampleData, 472)
PP_GamepadsSampleData
Definition:
ppb_gamepad.h:74
PP_GamepadSampleData
Definition:
ppb_gamepad.h:33
PPB_Gamepad_1_0::Sample
void(* Sample)(PP_Instance instance, struct PP_GamepadsSampleData *data)
Definition:
ppb_gamepad.h:103
pp_stdint.h
PP_Instance
int32_t PP_Instance
Definition:
pp_instance.h:34
PP_GamepadSampleData::connected
PP_Bool connected
Definition:
ppb_gamepad.h:65
PP_Bool
PP_Bool
Definition:
pp_bool.h:30
PP_GamepadsSampleData::items
struct PP_GamepadSampleData items[4]
Definition:
ppb_gamepad.h:84
Generated on Wed Apr 5 2017 11:09:16 for Pepper_47_C_interfaces by
1.8.6