raylib-go
raylib-go copied to clipboard
Places where slices are expected are pointers to underlying value instead (Model, Font)
Hello, sorry for the confusing / generic title.
It seems like in a few places where, say, the C sources expect a pointer to the start of an array of elements, it's the exact same in Go. It feels like it should be expecting a pointer to a slice of the underlying elements instead.
For example:
rl.LoadFontEx()still takes a pointer to anint32for the font characters to load, when it should presumably be a slice of runes.rl.Model.Materialsis a pointer to a singularrl.Material, when it probably should be a slice of the Materials in use on the Model. Same forrl.Model.Meshes,rl.Model.Bones, andrl.Model.Materials.Maps.
rl.Model.Materials I am not touching that again, it is what it is, it caused a lot of problems before. LoadFontEx can be modified, PR is welcomed.
Pointer to rl.Material in C is array btw.
Examples now use the new function SetMaterialTexture, similar functions are needed in order for this to work, or user can use unsafe/C to set this. Not easy, but can be done.