f3d
f3d copied to clipboard
Add C bindings for the libf3d
Is your feature request related to a problem? Please describe. Currently, the libf3d has a C++11 API and provides bindings in python and javascript (experimental).
Providing C bindings would open libf3d usage to many other languages, especially Julia and Rust.
Let's see if there is an interest for this. If you have interest, please do not hesitate to comment on this issue.
@mwestphal please assign this to me
Here's my opinion on this topic:
- Functions of the form
instance.function(arg1, arg2)
should look likefunction(instance, arg1, arg2)
- Return references should become argument pointers
- Returned
std::vector
should becomeint* size
andT* ptr
arguments
We should add the bindings directly in the public headers where it's appropriate, it should look like:
#ifdef __cplusplus
/* C++ class definition here*/
extern "C" {
#endif
/* C bindings definition here*/
#ifdef __cplusplus
}
#endif
I'll work on this!
Need any help @parkerstafford ? :)
Hey @parkerstafford , need any help moving forward ?
first version here: https://github.com/f3d-app/f3d/pull/1444