Original date:2019-07-04 23:43:10 Edited by: ghaberek Subject: Re: Euraylib Released!

David, you are correct. This is similar to the issue I explained here:

Basically, when we see a structure being passed by value, we have to expand its values as separate parameters. Since Vector2 is two floats, and floats are 32-bit values, it expands to {C_FLOAT,C_FLOAT}. This should work fine for passing structures by value, and is pretty straight-forward when the values are all 32-bit or greater. But as I pointed out in that thread, sometimes the structure members have to be packed into a larger value, which complicates things a bit (e.g. four unsigned chars becomes one unsigned int).

The bad news is that, at least until someone can go fix it in the backend, you cannot receive structures by value from an external function. I know Allegro does this. Not sure if Raylib is the same. This should be as simple as changing the return_type from atom to object and just pull more values off the stack after the function returns.


Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu