-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make types in the C# API partial
#1670
Comments
Can you provide a small diff as an example so I can be sure to get it correct? |
Making the declarations partial won't hurt, so just do it for every single declaration of Here is how it works: A minimal diff with the first occurrences of (differently looking) declarations: -public struct IVRSystem
+public partial struct IVRSystem
-public class Utils
+public partial class Utils
-[StructLayout(LayoutKind.Explicit)] public struct VREvent_Data_t
+[StructLayout(LayoutKind.Explicit)] public partial struct VREvent_Data_t
-public class OpenVR
+public partial class OpenVR
{
- class COpenVRContext
+ partial class COpenVRContext
} Maybe the generation should be public? There's lots more to improve, but for that you need people who are really into C#. Don't special case Unity. That can be moved out of the |
We've added the scripts used to generate these bindings here: |
Consider declaring the types in
/openvr/headers/openvr_api.cs
with thepartial
modifier.This will greatly simplify integrating the types in applications, because that way the types can be augmented with for example conversion or reinterpret cast operators without touching the autogenerated file.
The text was updated successfully, but these errors were encountered: