blob: a04223685b091b5f04531450e5978d00b241fc86 (
plain)
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
|
Codegen
---
The OpenVR SDK ships with metadata for its headers at [openvr_api.json](https://github.com/ValveSoftware/openvr/blob/master/headers/openvr_api.json).
This can be used to generate bindings for other languages such as C or C#.
We include the scripts we use to generate the existing bindings that ship as part of the SDK here.
### Usage
These scripts assume Python 2.7.
We use [Artistic Style](http://astyle.sourceforge.net/) for formatting.
#### C# bindings:
```
python openvr_interop.cs.py > openvr_interop.cs
astyle -T -O openvr_interop.cs
```
#### C bindings:
```
python openvr_capi.h.py > openvr_capi.h
astyle -T -O openvr_capi.h
```
#### C implementation:
This file is build into openvr_api.dll and is used by both the C and C# bindings.
```
python openvr_capi.cpp.py > openvr_capi.cpp
astyle -T -O openvr_capi.cpp
```
|