We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The SDL2 documentation says you can pass in NULL indices.
The go-sdl2 function assumes there is at least one indice passed in:
I presume the fix is probably something like this:
diff --git a/sdl/render.go b/sdl/render.go index 6e2abab..45b67c9 100644 --- a/sdl/render.go +++ b/sdl/render.go @@ -1176,9 +1176,10 @@ func (renderer *Renderer) RenderGeometry(texture *Texture, vertices []Vertex, in _texture := texture.cptr() _vertices := (*C.SDL_Vertex)(unsafe.Pointer(&vertices[0])) _num_vertices := C.int(len(vertices)) - _indices := (*C.int)(unsafe.Pointer(&indices[0])) + var _indices *C.int _num_indices := C.int(0) if indices != nil { + _indices = (*C.int)(unsafe.Pointer(&indices[0])) _num_indices = C.int(len(indices)) } err = errorFromInt(int(C.SDL_RenderGeometry(renderer.cptr(), _texture, _vertices, _num_vertices, _indices, _num_indices)))
The text was updated successfully, but these errors were encountered:
Thanks for reporting the issue and providing the fix @advisoft! I have applied it and tagged a new patch release with v0.4.20.
v0.4.20
Sorry, something went wrong.
Thank you.
No branches or pull requests
The SDL2 documentation says you can pass in NULL indices.
The go-sdl2 function assumes there is at least one indice passed in:
I presume the fix is probably something like this:
The text was updated successfully, but these errors were encountered: