Cast to C.SDL_Rect is wrong, due to int size
jsfr opened this issue · comments
Jens Fredskov commented
As far as I can see C.SDL_Rect uses standard C ints (and not int16). Thus when the sdl.Rect is casted the int16 and uint16 fields as only half of an int. This means that the width, height, x and y of a rectangle gets all screwed up, and often nothing can be seen.
I'm not all to sharp in C, but as at least on my 64-bit machine changing the sdl.Rect fields to int32 in structs_amd64.go seems to do the trick.
This is similar to how it is done in veandco's SDL-wrapper, see rect.go.
Jens Fredskov commented
Functions this affect is e.g. Render.FillRect(&rect)
Jens Fredskov commented
Closing as this seems to go nowhere