Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Calling C function from Raku

by Nine (Novice)
on Mar 18, 2020 at 13:42 UTC ( #11114429=note: print w/replies, xml ) Need Help??


in reply to Calling C function from Raku

I bet on that Color argument. I don't think we support passing structs as value types. They will be passed as pointers instead which in turn will be interpreted as a color by that function (which causes the apparent randomness). Please try passing a manually packed uint32 instead: $r +< 24 +| $g +< 16 +| $b +< 8 +| $a (or maybe the other way round)

Replies are listed 'Best First'.
Re^2: Calling C function from Raku
by BenM (Initiate) on Mar 18, 2020 at 21:32 UTC
    Oh I should have thought of that. Structs being passed as a pointer makes complete sense. I gave it a go and packing a uint32 worked perfectly! Thank you very much for the help!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11114429]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (1)
As of 2022-01-23 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?