Skip to content
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

C API #3

Open
lilleyse opened this issue Oct 31, 2022 · 2 comments
Open

C API #3

lilleyse opened this issue Oct 31, 2022 · 2 comments

Comments

@lilleyse
Copy link
Contributor

We should consider providing an ABI stable C interface for CesiumOmniverse, inspired by the concept of Omniverse Native Interfaces (ONI) as described in the Carbonite SDK documentation.

The initial skeleton of this can be found in CesiumOmniverse.h. We would need to think of an elegant way to pass through USD objects such as UsdStageRefPtr and GfMatrix4d.

This also affects the Python API which is essentially just a wrapper of the C++ API. If we switched to a C API we could consider switching from pybind11 to cython.

@lilleyse
Copy link
Contributor Author

lilleyse commented Nov 9, 2022

Mostly fixed in #44. The functions exported from CesiumOmniverse.dll are now exported as C functions.

However CesiumOmniverse.h still includes some pxr headers, which means that you can't include CesiumOmniverse.h in a C project. pxr::UsdStageRefPtr in particular is a problem because it's a somewhat complicated typedef and not easy to forward declare.

@lilleyse
Copy link
Contributor Author

The dependency on pxr headers was removed in #626. However we still have a lot of C++ runtime types in the interface, which is disallowed (see http://omniverse-docs.s3-website-us-east-1.amazonaws.com/carbonite/164.0-pre/docs/ABI.html#c-runtime-library-types).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant