1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/***************************************************************************
* XPLMInstance
***************************************************************************/
/*
* This API provides instanced drawing of X-Plane objects (.obj files). In
* contrast to old drawing APIs, which required you to draw your own objects
* per-frame, the instancing API allows you to simply register an OBJ for
* drawing, then move or manipulate it later (as needed).
*
* This provides one tremendous benefit: it keeps all dataref operations for
* your object in one place. Because datarefs access may be done from the main
* thread only, allowing dataref access anywhere is a serious performance
* bottleneck for the simulator - the whole simulator has to pause and wait
* for each dataref access. This performance penalty will only grow worse as
* X-Plane moves toward an ever more heavily multithreaded engine.
*
* The instancing API allows X-Plane to isolate all dataref manipulations for
* all plugin object drawing to one place, potentially providing huge
* performance gains.
*
* Here's how it works:
*
* When an instance is created, it provides a list of all datarefs you want to
* manipulate for the OBJ in the future. This list of datarefs replaces the
* ad-hoc collections of dataref objects previously used by art assets. Then,
* per-frame, you can manipulate the instance by passing in a "block" of
* packed floats representing the current values of the datarefs for your
* instance. (Note that the ordering of this set of packed floats must exactly
* match the ordering of the datarefs when you created your instance.)
*
*/
extern "C" __cplusplus
}