Replies: 2 comments
-
|
@VisenDev I'm afraid that's completely out of scope for raylib, it would increase code size, maintenance cost and confuse many users. No plans to take raylib in that direction. |
Beta Was this translation helpful? Give feedback.
-
|
I think delivering function results as pointers to structs, instead of delivering struct results directly, is also inappropriate, since now (using the offered examples) the recipient of the result has to manage the storage of the struct. The whole point of being able to efficiently pass small structs by value as parameters and as results would be completely defeated. Other languages do have bindings that make this all work. If there is serious interest in something like Common LISP, or a version of Scheme, It is up to experts there to provide a decent binding/wrapper to have it work there. Treating the particular situation in raylib would defeat the performance with which these structs are manipulated, produced and consumed. It's not broken; please don't try to fix it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When creating raylib bindings for other programming languages, the fact that many functions require for structures to be passed by value creates great difficulty. It requires a much more complex FFI to pass a structure by value than to pass one by reference.
For example, in the common lisp programming language, the major implementations lack good support for passing structs by value, so wrapper shims have to be created which wrap calls to existing pass by value raylib functions inside of pass by reference versions. You can see an example of this here.
It would be useful if pass struct by reference wrappers for all pass struct by value functions were included in the base library.
Beta Was this translation helpful? Give feedback.
All reactions