ebitengine / purego

Apache License 2.0
2.16k stars 68 forks source link

purego: add float32 and float64 support to callbacks #120

Closed TotallyGamerJet closed 1 year ago

TotallyGamerJet commented 1 year ago

This commit adds support for float32 and float64 arguments in C callbacks. It also adds a test to check the maximum number of arguments a callback can have and that it is callback properly by purego. There is also some formatting done to the assembly.

hajimehoshi commented 1 year ago

I'm gonna sleep soon so I'll take a look tomorrow. Good night...

TotallyGamerJet commented 1 year ago

By the way, Does a callback work even if this mixes float32 and float64 as this arguments?

Yes! I added a test for that case (TestNewCallbackFloat32AndFloat64)