Open Lcbx opened 2 years ago
just found a bug using this.
some arguments expect pointers but can be given non ffi pointers ;
however since signatures expects a pointer it calls ffi.addressof
on the argument and crashes. Imma fix that.
not the best fix but it works
found a way to check on type rather than str(type)
should be robust and work with dynamic since the C_POINTER type we check is determined in pyRay init
This looks like quite a major change so will probably take me a while to review it. Let me know when it’s finished anyway.
The implementation change is around 15 loc, only in pyray/init.py other files are changes to examples
oh yeah and it's pretty much finished afaik, tested it on a few examples (your pyrayTest, bunnyMark, boxCollisions and animation)
Example is added, thanks. I had to add an unsigned int* to satisfy Raylib though,
oh i see, you wrote a special case for that call to add the unsigned int*. i don't really want to be special casing anything.
do you have a benchmark that shows a difference for the changes to pyray/init.py ?
Hi,
while testing the Pyray module I stumbled upon your comment about function calls using a lot of string comparisons at runtime, so here's an alternative that basically converts python arguments to the type expected by the c function.
Interestingly I have not found that great a performance improvement on the script I tested it on (~3%) but at least we don't inspect the c function at each call anymore.
keep being awesome !