veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

feature req: img.LoadSizedSVG #596

Closed nergdron closed 2 months ago

nergdron commented 2 months ago

Go version: go1.22.2 linux/amd64 Go-SDL2 version: v0.4.38 SDL2 version: 2.30.2-1 OS: endeavouros (arch variant) Architecture: amd64

using the current bindings I can load SVG files using img.Load(), but there's no control over what resolution they get rendered to inside of SDL, and it seems to default to something pretty low res. it looks like upstream has a function in SDL_img to handle this since version 2.6.0, so it'd be great if we could get this one function wrapped to make dealing with SVG rendering a lot more manageable:

https://wiki.libsdl.org/SDL2_image/IMG_LoadSizedSVG_RW

veeableful commented 2 months ago

Hi @nergdron, I have implemented the binding in the master branch. Would you care to test it out?

nergdron commented 2 months ago

ahhh perfect, that's exactly what I needed! thanks so much for the fast turnaround on this, makes working with SVG files in SDL so much nicer, now everything is crisp and clean like it should be!