diff --git a/go.mod b/go.mod index e4afee0..6bd052d 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/fogleman/fauxgl v0.0.0-20200818143847-27cddc103802 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 - github.com/veandco/go-sdl2 v0.4.10 + github.com/veandco/go-sdl2 v0.4.36 github.com/xyproto/pf v0.1.0 - github.com/xyproto/sdl2utils v0.0.2 + github.com/xyproto/sdl2utils v0.0.3 ) diff --git a/go.sum b/go.sum index 7bdbf0a..9d8edad 100644 --- a/go.sum +++ b/go.sum @@ -7,13 +7,15 @@ github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/veandco/go-sdl2 v0.4.0/go.mod h1:FB+kTpX9YTE+urhYiClnRzpOXbiWgaU3+5F2AB78DPg= github.com/veandco/go-sdl2 v0.4.8/go.mod h1:OROqMhHD43nT4/i9crJukyVecjPNYYuCofep6SNiAjY= -github.com/veandco/go-sdl2 v0.4.10 h1:8QoD2bhWl7SbQDflIAUYWfl9Vq+mT8/boJFAUzAScgY= -github.com/veandco/go-sdl2 v0.4.10/go.mod h1:OROqMhHD43nT4/i9crJukyVecjPNYYuCofep6SNiAjY= +github.com/veandco/go-sdl2 v0.4.36 h1:Ltydev536rRQodmIrTWFZ3dRp5A+/6t5CYvbi4Kvia0= +github.com/veandco/go-sdl2 v0.4.36/go.mod h1:OROqMhHD43nT4/i9crJukyVecjPNYYuCofep6SNiAjY= github.com/xyproto/multirender v0.0.0-20210812160008-b09d0e851269/go.mod h1:NuGNCBuS6hYRp8HNgzPLELdT4X8n0N3jGcE6MwZfp9E= github.com/xyproto/pf v0.0.0-20181025124322-7074da227fa9/go.mod h1:gFY4ElmPdzIugLXkqXbHZ/5YPyMrApUTDXawHCj9KBI= github.com/xyproto/pf v0.1.0 h1:eRNs6hP2WyPWmf/XLM5GfWm5sEiKzSg0B8wXlN8Rl9I= github.com/xyproto/pf v0.1.0/go.mod h1:rtltCHXE42yF2p802kl3h6ILFdjrGAe+SCmKHFlBl9M= github.com/xyproto/pixelpusher v0.0.0-20210812161021-2b0152ae3a90/go.mod h1:0AhWORbB8lGJlDaqQz1RmDmBnk32buv0CsUlKiNrFFI= +github.com/xyproto/pixelpusher v1.0.0/go.mod h1:UJcq1T73wPmbcMDDyLZJMAnC9Oy4u7AD8PiaMDVJAuU= github.com/xyproto/sdl2utils v0.0.0-20180825143422-1d41a661b4cb/go.mod h1:/SEUe3Ed5TBJ6kjWqEob0E49WFaAykUUx3WrlIEbl0g= -github.com/xyproto/sdl2utils v0.0.2 h1:NVVSR+g69e5052lJa5gtijWym0WG+gt3SlhgmcRJm6Q= github.com/xyproto/sdl2utils v0.0.2/go.mod h1:Ht8y1WLQ3Y9peiQ9jsRvP0qdS5R6iYlvD0/SxMMfoqw= +github.com/xyproto/sdl2utils v0.0.3 h1:unDtrMGF3bU4duQDBb7MMFdernpR66J2aLWomdDJ31E= +github.com/xyproto/sdl2utils v0.0.3/go.mod h1:2kiJb9zf7eqD9t8V7g+FfC+xhZ/fYjzsER4HCmYIwwg= diff --git a/vendor/github.com/veandco/go-sdl2/_libs/dummy.go b/vendor/github.com/veandco/go-sdl2/_libs/dummy.go new file mode 100644 index 0000000..767b91e --- /dev/null +++ b/vendor/github.com/veandco/go-sdl2/_libs/dummy.go @@ -0,0 +1 @@ +package dummy diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_android_arm.a new file mode 100644 index 0000000..3955382 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_darwin_amd64.a new file mode 100644 index 0000000..809567d Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_darwin_arm64.a new file mode 100644 index 0000000..7c334ed Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_android_arm.a new file mode 100644 index 0000000..73150d1 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_darwin_amd64.a new file mode 100644 index 0000000..e0e0211 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_linux_386.a new file mode 100644 index 0000000..250aaf5 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_linux_amd64.a new file mode 100644 index 0000000..c077268 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_linux_arm.a new file mode 100644 index 0000000..ca07372 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_windows_386.a new file mode 100644 index 0000000..42c8792 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_windows_amd64.a new file mode 100644 index 0000000..2e79f52 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_gfx_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_android_arm.a new file mode 100644 index 0000000..f2313fd Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_darwin_amd64.a new file mode 100644 index 0000000..ff7f1ff Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_darwin_arm64.a new file mode 100644 index 0000000..e0bc5eb Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_linux_386.a new file mode 100644 index 0000000..0b8a2a8 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_linux_amd64.a new file mode 100644 index 0000000..f4502bb Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_linux_arm.a new file mode 100644 index 0000000..42a02d4 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_windows_386.a new file mode 100644 index 0000000..7ba15aa Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_windows_amd64.a new file mode 100644 index 0000000..99e9562 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_image_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_linux_386.a new file mode 100644 index 0000000..e5c18e0 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_linux_amd64.a new file mode 100644 index 0000000..1124539 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_linux_arm.a new file mode 100644 index 0000000..b45294b Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_android_arm.a new file mode 100644 index 0000000..e6931ca Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_darwin_amd64.a new file mode 100644 index 0000000..d80e0b5 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_darwin_arm64.a new file mode 100644 index 0000000..a63b1c3 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_linux_386.a new file mode 100644 index 0000000..65f5150 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_linux_amd64.a new file mode 100644 index 0000000..b988888 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_linux_arm.a new file mode 100644 index 0000000..5d89d49 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_windows_386.a new file mode 100644 index 0000000..0d33aef Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_windows_amd64.a new file mode 100644 index 0000000..f888bd6 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_mixer_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_android_arm.a new file mode 100644 index 0000000..add4519 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_darwin_amd64.a new file mode 100644 index 0000000..cec7005 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_darwin_arm64.a new file mode 100644 index 0000000..4525e7c Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_linux_386.a new file mode 100644 index 0000000..0e40f5b Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_linux_amd64.a new file mode 100644 index 0000000..b322096 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_linux_arm.a new file mode 100644 index 0000000..8ee083c Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_windows_386.a new file mode 100644 index 0000000..3ce7b0e Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_windows_amd64.a new file mode 100644 index 0000000..1938c57 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_ttf_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_windows_386.a new file mode 100644 index 0000000..86a6c8f Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_windows_amd64.a new file mode 100644 index 0000000..7a0c158 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_android_arm.a new file mode 100644 index 0000000..2faab1a Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_darwin_amd64.a new file mode 100644 index 0000000..86f721f Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_linux_386.a new file mode 100644 index 0000000..51e70f5 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_linux_amd64.a new file mode 100644 index 0000000..6d9bb3d Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_linux_arm.a new file mode 100644 index 0000000..366b6b7 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_windows_386.a new file mode 100644 index 0000000..e3ddb60 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_windows_amd64.a new file mode 100644 index 0000000..a7bca83 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libSDL2main_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_android_arm.a new file mode 100644 index 0000000..7a19e20 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_darwin_amd64.a new file mode 100644 index 0000000..ecb3403 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_darwin_arm64.a new file mode 100644 index 0000000..9c0d037 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_linux_386.a new file mode 100644 index 0000000..78dd3f0 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_linux_amd64.a new file mode 100644 index 0000000..678a40e Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_linux_arm.a new file mode 100644 index 0000000..0c86142 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_windows_386.a new file mode 100644 index 0000000..925df5c Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_windows_amd64.a new file mode 100644 index 0000000..06a86c7 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libfreetype_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_android_arm.a new file mode 100644 index 0000000..d8c5bb4 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_darwin_amd64.a new file mode 100644 index 0000000..96ed3e5 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_darwin_arm64.a new file mode 100644 index 0000000..221f7dc Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_linux_386.a new file mode 100644 index 0000000..5f54db7 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_linux_amd64.a new file mode 100644 index 0000000..9e7bbb7 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_linux_arm.a new file mode 100644 index 0000000..428b804 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_windows_386.a new file mode 100644 index 0000000..2e24c98 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_windows_amd64.a new file mode 100644 index 0000000..eb54908 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libjpeg_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_android_arm.a new file mode 100644 index 0000000..3b84d39 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_darwin_amd64.a new file mode 100644 index 0000000..809d051 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_darwin_arm64.a new file mode 100644 index 0000000..20b623f Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_linux_386.a new file mode 100644 index 0000000..4b1b4e8 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_linux_amd64.a new file mode 100644 index 0000000..3500d4c Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_linux_arm.a new file mode 100644 index 0000000..b9c2f1a Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_windows_386.a new file mode 100644 index 0000000..4f41bc9 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_windows_amd64.a new file mode 100644 index 0000000..8bec966 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libmpg123_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libogg_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libogg_android_arm.a new file mode 100644 index 0000000..17b2b88 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libogg_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libogg_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libogg_darwin_amd64.a new file mode 100644 index 0000000..4e782fd Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libogg_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libogg_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libogg_darwin_arm64.a new file mode 100644 index 0000000..6d799f8 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libogg_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libogg_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libogg_linux_386.a new file mode 100644 index 0000000..c6e0aef Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libogg_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libogg_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libogg_linux_amd64.a new file mode 100644 index 0000000..fd50e3b Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libogg_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libogg_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libogg_linux_arm.a new file mode 100644 index 0000000..7aad4f7 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libogg_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libogg_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libogg_windows_386.a new file mode 100644 index 0000000..1235cfa Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libogg_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libogg_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libogg_windows_amd64.a new file mode 100644 index 0000000..45d0bdc Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libogg_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libpng_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libpng_android_arm.a new file mode 100644 index 0000000..2ab621c Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libpng_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libpng_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libpng_darwin_amd64.a new file mode 100644 index 0000000..5863e12 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libpng_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libpng_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libpng_darwin_arm64.a new file mode 100644 index 0000000..9cf62e6 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libpng_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libpng_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libpng_linux_386.a new file mode 100644 index 0000000..d423664 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libpng_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libpng_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libpng_linux_amd64.a new file mode 100644 index 0000000..4c72996 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libpng_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libpng_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libpng_linux_arm.a new file mode 100644 index 0000000..26932ee Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libpng_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libpng_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libpng_windows_386.a new file mode 100644 index 0000000..c6ebc11 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libpng_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libpng_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libpng_windows_amd64.a new file mode 100644 index 0000000..0b0993f Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libpng_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_android_arm.a new file mode 100644 index 0000000..1c35572 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_darwin_amd64.a new file mode 100644 index 0000000..0bb1f9b Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_darwin_arm64.a new file mode 100644 index 0000000..eeec45c Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_linux_386.a new file mode 100644 index 0000000..29fd17a Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_linux_amd64.a new file mode 100644 index 0000000..ecddb6d Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_linux_arm.a new file mode 100644 index 0000000..f355eb9 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_windows_386.a new file mode 100644 index 0000000..1dff310 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_windows_amd64.a new file mode 100644 index 0000000..8520bf9 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbis_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_android_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_android_arm.a new file mode 100644 index 0000000..f81aba7 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_android_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_darwin_amd64.a new file mode 100644 index 0000000..e37139e Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_darwin_arm64.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_darwin_arm64.a new file mode 100644 index 0000000..982a1fb Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_darwin_arm64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_linux_386.a new file mode 100644 index 0000000..bd624e2 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_linux_amd64.a new file mode 100644 index 0000000..dd58749 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_linux_arm.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_linux_arm.a new file mode 100644 index 0000000..e96941a Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_linux_arm.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_windows_386.a new file mode 100644 index 0000000..0c2479a Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_windows_amd64.a new file mode 100644 index 0000000..ac0d6c4 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libvorbisfile_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libz_darwin_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libz_darwin_amd64.a new file mode 100644 index 0000000..5f321c4 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libz_darwin_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libz_linux_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libz_linux_386.a new file mode 100644 index 0000000..aa3ea05 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libz_linux_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libz_linux_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libz_linux_amd64.a new file mode 100644 index 0000000..fdcfc3d Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libz_linux_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libz_windows_386.a b/vendor/github.com/veandco/go-sdl2/_libs/libz_windows_386.a new file mode 100644 index 0000000..5a7ab12 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libz_windows_386.a differ diff --git a/vendor/github.com/veandco/go-sdl2/_libs/libz_windows_amd64.a b/vendor/github.com/veandco/go-sdl2/_libs/libz_windows_amd64.a new file mode 100644 index 0000000..cab0237 Binary files /dev/null and b/vendor/github.com/veandco/go-sdl2/_libs/libz_windows_amd64.a differ diff --git a/vendor/github.com/veandco/go-sdl2/sdl/TODO.md b/vendor/github.com/veandco/go-sdl2/sdl/TODO.md index c4042e8..61e2c6d 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/TODO.md +++ b/vendor/github.com/veandco/go-sdl2/sdl/TODO.md @@ -1,3 +1,108 @@ +## 2.0.16 + +[x] SDL_FlashWindow() to get a user’s attention +[x] SDL_GetAudioDeviceSpec() to get the preferred audio format of a device +[x] SDL_SetWindowAlwaysOnTop() to dynamically change the SDL_WINDOW_ALWAYS_ON_TOP flag for a window +[x] SDL_SetWindowKeyboardGrab() to support grabbing the keyboard independently of the mouse +[x] SDL_SoftStretchLinear() to do bilinear scaling between 32-bit software surfaces +[x] SDL_UpdateNVTexture() to update streaming NV12/21 textures +[x] SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow sending custom trigger effects to the DualSense controller +[x] SDL_GameControllerGetSensorDataRate() to get the sensor data rate for PlayStation and Nintendo Switch controllers + +### Windows + +[?] SDL_SetWindowsMessageHook() to set a function that is called for all Windows messages +[?] SDL_RenderGetD3D11Device() to get the D3D11 device used by the SDL renderer + +### Linux + +[x] SDL_HINT_AUDIO_INCLUDE_MONITORS to control whether PulseAudio recording should include monitor devices +[x] SDL_HINT_AUDIO_DEVICE_STREAM_ROLE to describe the role of your application for audio control panels + +### Android: + +[?] SDL_AndroidShowToast() to show a lightweight notification + +## 2.0.14 + +[x] SDL_GameControllerGetSerial() +[x] SDL_GameControllerHasAxis() +[x] SDL_GameControllerHasButton() +[x] SDL_GameControllerGetNumTouchpads() +[x] SDL_GameControllerGetNumTouchpadFingers() +[x] SDL_GameControllerGetTouchpadFinger() +[x] SDL_GameControllerHasSensor() +[x] SDL_GameControllerSetSensorEnabled() +[x] SDL_GameControllerIsSensorEnabled() +[x] SDL_GameControllerGetSensorData +[x] SDL_GameControllerRumbleTriggers() +[x] SDL_GameControllerHasLED() +[x] SDL_GameControllerSetLED() +[x] SDL_JoystickGetSerial() +[x] SDL_JoystickRumbleTriggers() +[x] SDL_JoystickHasLED() +[x] SDL_JoystickSetLED() +[x] SDL_JoystickAttachVirtual() +[x] SDL_JoystickDetachVirtual() +[x] SDL_JoystickIsVirtual() +[x] SDL_JoystickSetVirtualAxis() +[x] SDL_JoystickSetVirtualButton() +[x] SDL_JoystickSetVirtualHat() +[x] SDL_LockSensors() +[x] SDL_UnlockSensors() +[x] SDL_HAPTIC_STEERING_AXIS +[x] SDL_GetPreferredLocales() +[x] SDL_OpenURL() +[x] SDL_HasSurfaceRLE() +[x] SDL_SIMDRealloc() +[x] SDL_GetErrorMsg() +[x] SDL_Metal_GetLayer() +[x] SDL_Metal_GetDrawableSize() +[x] SDL_HINT_JOYSTICK_HIDAPI_PS5 +[x] SDL_HINT_MOUSE_RELATIVE_SCALING +[x] SDL_HINT_PREFERRED_LOCALES +[x] SDL_HINT_JOYSTICK_RAWINPUT +[x] SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT +[x] SDL_HINT_AUDIO_DEVICE_APP_NAME +[x] SDL_HINT_AUDIO_DEVICE_STREAM_NAME +[x] SDL_HINT_LINUX_JOYSTICK_DEADZONES +[x] SDL_HINT_THREAD_PRIORITY_POLICY +[x] SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL +[x] SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO +[x] SDL_HINT_EMSCRIPTEN_ASYNCIFY +[x] SDL_PIXELFORMAT_XRGB4444 +[x] SDL_PIXELFORMAT_XBGR4444 +[x] SDL_PIXELFORMAT_XRGB1555 +[x] SDL_PIXELFORMAT_XBGR1555 +[x] SDL_PIXELFORMAT_XRGB8888 +[x] SDL_PIXELFORMAT_XBGR8888 +[x] SDL_WINDOW_METAL +[x] SDL_AndroidRequestPermission() + +## 2.0.12 + +[x] SDL_GameControllerTypeForIndex +[x] SDL_GameControllerGetType +[x] SDL_GameControllerFromPlayerIndex +[x] SDL_GameControllerSetPlayerIndex +[x] SDL_JoystickFromPlayerIndex +[x] SDL_JoystickSetPlayerIndex +[x] SDL_GetTextureScaleMode +[x] SDL_SetTextureScaleMode +[x] SDL_LockTextureToSurface +[x] SDL_BLENDMODE_MUL +[x] SDL_TouchFingerEvent update +[x] SDL_HasARMSIMD +[x] SDL_HINT_DISPLAY_USABLE_BOUNDS +[x] SDL_HINT_GAMECONTROLLERTYPE +[x] SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS +[x] SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE +[x] SDL_HINT_VIDEO_X11_WINDOW_VISUALID +[x] SDL_HINT_VIDEO_X11_FORCE_EGL +[x] SDL_Metal_CreateView +[x] SDL_Metal_DestroyView +[x] SDL_GetAndroidSDKVersion + ## 2.0.10 [x] SDL_SIMDGetAlignment diff --git a/vendor/github.com/veandco/go-sdl2/sdl/audio.go b/vendor/github.com/veandco/go-sdl2/sdl/audio.go index 03e1e41..d4769d2 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/audio.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/audio.go @@ -108,6 +108,20 @@ static void SDL_FreeAudioStream(SDL_AudioStream *stream) { } +#endif + +#if !(SDL_VERSION_ATLEAST(2,0,16)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_GetAudioDeviceSpec is not supported before SDL 2.0.16") +#endif + +static int SDL_GetAudioDeviceSpec(int index, int iscapture, SDL_AudioSpec *spec) +{ + return -1; +} + + #endif */ import "C" @@ -483,16 +497,16 @@ func QueueAudio(dev AudioDeviceID, data []byte) error { return nil } -// DequeueAudio dequeues more audio on non-callback devices. +// DequeueAudio dequeues more audio on non-callback devices. Returns the number of bytes dequeued, which could be less than requested // (https://wiki.libsdl.org/SDL_DequeueAudio) -func DequeueAudio(dev AudioDeviceID, data []byte) error { +func DequeueAudio(dev AudioDeviceID, data []byte) (n int, err error) { sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&data)) _data := unsafe.Pointer(sliceHeader.Data) _len := (C.Uint32)(sliceHeader.Len) - if C.SDL_DequeueAudio(dev.c(), _data, _len) != 0 { - return GetError() + if dequeued := int(C.SDL_DequeueAudio(dev.c(), _data, _len)); dequeued > 0 { + return dequeued, nil } - return nil + return 0, GetError() } // GetQueuedAudioSize returns the number of bytes of still-queued audio. @@ -587,15 +601,17 @@ func (stream *AudioStream) Put(buf []byte) (err error) { return } -// Get gets converted/resampled data from the stream -// TODO: (https://wiki.libsdl.org/SDL_AudioStreamGet) -func (stream *AudioStream) Get(buf []byte) (err error) { +// Get gets converted/resampled data from the stream. Returns the number of bytes read from the stream. +// (https://wiki.libsdl.org/SDL_AudioStreamGet) +func (stream *AudioStream) Get(buf []byte) (n int, err error) { sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) _buf := unsafe.Pointer(sliceHeader.Data) _len := C.int(len(buf)) - ret := int(C.SDL_AudioStreamGet(stream.cptr(), _buf, _len)) - err = errorFromInt(ret) - return + if ret := int(C.SDL_AudioStreamGet(stream.cptr(), _buf, _len)); ret < 0 { + return 0, errorFromInt(ret) + } else { + return ret, nil + } } // Available gets the number of converted/resampled bytes available @@ -626,3 +642,11 @@ func (stream *AudioStream) Clear() { func (stream *AudioStream) Free() { C.SDL_FreeAudioStream(stream.cptr()) } + +// GetAudioDeviceSpec returns the preferred audio format of a specific audio device. +// (https://wiki.libsdl.org/SDL_GetAudioDeviceSpec) +func GetAudioDeviceSpec(index int, isCapture bool) (spec *AudioSpec, err error) { + spec = &AudioSpec{} + err = errorFromInt(int(C.SDL_GetAudioDeviceSpec(C.int(index), C.int(Btoi(isCapture)), spec.cptr()))) + return +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/events.go b/vendor/github.com/veandco/go-sdl2/sdl/events.go index eacf0d9..7065a22 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/events.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/events.go @@ -90,12 +90,113 @@ typedef struct SDL_SensorEvent { Sint32 which; float data[6]; } SDL_SensorEvent; +#endif + +#if !SDL_VERSION_ATLEAST(2,0,22) +#if defined(WARN_OUTDATED) +#pragma message("SDL_TEXTEDITING_EXT is not supported before SDL 2.0.22") +#endif + +#define SDL_TEXTEDITING_EXT (0x305) +#endif + +// NOTE: To prevent build from failing when using older SDL2, we create a +// structure definiton that directly maps to the SDL2 struct definition if +// using the latest SDL2. Otherwise, we copy the latest definition and paste +// it here. +#if SDL_VERSION_ATLEAST(2,0,22) +typedef SDL_MouseButtonEvent MouseButtonEvent; +typedef SDL_MouseWheelEvent MouseWheelEvent; +typedef SDL_TouchFingerEvent TouchFingerEvent; +typedef SDL_DropEvent DropEvent; +#else +typedef struct MouseButtonEvent +{ + Uint32 type; // ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP + Uint32 timestamp; + Uint32 windowID; // The window with mouse focus, if any + Uint32 which; // The mouse instance id, or SDL_TOUCH_MOUSEID + Uint8 button; // The mouse button index + Uint8 state; // ::SDL_PRESSED or ::SDL_RELEASED + Uint8 clicks; // 1 for single-click, 2 for double-click, etc. + Uint8 padding1; + Sint32 x; // X coordinate, relative to window + Sint32 y; // Y coordinate, relative to window +} MouseButtonEvent; + +typedef struct MouseWheelEvent +{ + Uint32 type; // ::SDL_MOUSEWHEEL + Uint32 timestamp; // In milliseconds, populated using SDL_GetTicks() + Uint32 windowID; // The window with mouse focus, if any + Uint32 which; // The mouse instance id, or SDL_TOUCH_MOUSEID + Sint32 x; // The amount scrolled horizontally, positive to the right and negative to the left + Sint32 y; // The amount scrolled vertically, positive away from the user and negative toward the user + Uint32 direction; // Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back + float preciseX; // The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) + float preciseY; // The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) +} MouseWheelEvent; + +typedef struct TouchFingerEvent +{ + Uint32 type; // ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP + Uint32 timestamp; // In milliseconds, populated using SDL_GetTicks() + SDL_TouchID touchId; // The touch device id + SDL_FingerID fingerId; // + float x; // Normalized in the range 0...1 + float y; // Normalized in the range 0...1 + float dx; // Normalized in the range -1...1 + float dy; // Normalized in the range -1...1 + float pressure; // Normalized in the range 0...1 + Uint32 windowID; // The window underneath the finger, if any +} TouchFingerEvent; + +typedef struct DropEvent +{ + Uint32 type; // ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE + Uint32 timestamp; // In milliseconds, populated using SDL_GetTicks() + char *file; // The file name, which should be freed with SDL_free(), is NULL on begin/complete + Uint32 windowID; // The window that was dropped on, if any +} DropEvent; + +#endif + +#if !SDL_VERSION_ATLEAST(2,24,0) +#if defined(WARN_OUTDATED) +#pragma message("SDL_JOYBATTEYUPDATED is not supported before SDL 2.24.0") +#endif + +#define SDL_JOYBATTERYUPDATED (1543) + +#if !SDL_VERSION_ATLEAST(2,0,4) +typedef enum +{ + SDL_JOYSTICK_POWER_UNKNOWN = -1, + SDL_JOYSTICK_POWER_EMPTY, + SDL_JOYSTICK_POWER_LOW, + SDL_JOYSTICK_POWER_MEDIUM, + SDL_JOYSTICK_POWER_FULL, + SDL_JOYSTICK_POWER_WIRED, + SDL_JOYSTICK_POWER_MAX +} SDL_JoystickPowerLevel; +#endif + +typedef struct SDL_JoyBatteryEvent +{ + Uint32 type; + Uint32 timestamp; + SDL_JoystickID which; + SDL_JoystickPowerLevel level; +} SDL_JoyBatteryEvent; + #endif */ import "C" -import "unsafe" -import "reflect" -import "sync" +import ( + "reflect" + "sync" + "unsafe" +) var ( eventFilterCache EventFilter @@ -129,11 +230,12 @@ const ( SYSWMEVENT = C.SDL_SYSWMEVENT // system specific event // Keyboard events - KEYDOWN = C.SDL_KEYDOWN // key pressed - KEYUP = C.SDL_KEYUP // key released - TEXTEDITING = C.SDL_TEXTEDITING // keyboard text editing (composition) - TEXTINPUT = C.SDL_TEXTINPUT // keyboard text input - KEYMAPCHANGED = C.SDL_KEYMAPCHANGED // keymap changed due to a system event such as an input language or keyboard layout change (>= SDL 2.0.4) + KEYDOWN = C.SDL_KEYDOWN // key pressed + KEYUP = C.SDL_KEYUP // key released + TEXTEDITING = C.SDL_TEXTEDITING // keyboard text editing (composition) + TEXTINPUT = C.SDL_TEXTINPUT // keyboard text input + TEXTEDITING_EXT = C.SDL_TEXTEDITING_EXT // keyboard text editing (composition) + KEYMAPCHANGED = C.SDL_KEYMAPCHANGED // keymap changed due to a system event such as an input language or keyboard layout change (>= SDL 2.0.4) // Mouse events MOUSEMOTION = C.SDL_MOUSEMOTION // mouse moved @@ -440,13 +542,15 @@ func (e *MouseButtonEvent) GetTimestamp() uint32 { // MouseWheelEvent contains mouse wheel event information. // (https://wiki.libsdl.org/SDL_MouseWheelEvent) type MouseWheelEvent struct { - Type uint32 // MOUSEWHEEL - Timestamp uint32 // timestamp of the event - WindowID uint32 // the window with mouse focus, if any - Which uint32 // the mouse instance id, or TOUCH_MOUSEID - X int32 // the amount scrolled horizontally, positive to the right and negative to the left - Y int32 // the amount scrolled vertically, positive away from the user and negative toward the user - Direction uint32 // MOUSEWHEEL_NORMAL, MOUSEWHEEL_FLIPPED (>= SDL 2.0.4) + Type uint32 // MOUSEWHEEL + Timestamp uint32 // timestamp of the event + WindowID uint32 // the window with mouse focus, if any + Which uint32 // the mouse instance id, or TOUCH_MOUSEID + X int32 // the amount scrolled horizontally, positive to the right and negative to the left + Y int32 // the amount scrolled vertically, positive away from the user and negative toward the user + Direction uint32 // MOUSEWHEEL_NORMAL, MOUSEWHEEL_FLIPPED (>= SDL 2.0.4) + PreciseX float32 // The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) + PreciseY float32 // The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) } type cMouseWheelEvent C.SDL_MouseWheelEvent @@ -559,9 +663,9 @@ func (e *JoyButtonEvent) GetTimestamp() uint32 { // JoyDeviceAddedEvent contains joystick device event information. // (https://wiki.libsdl.org/SDL_JoyDeviceEvent) type JoyDeviceAddedEvent struct { - Type uint32 // JOYDEVICEADDED - Timestamp uint32 // the timestamp of the event - Which JoystickID // the joystick device index + Type uint32 // JOYDEVICEADDED + Timestamp uint32 // the timestamp of the event + Which JoystickID // the joystick device index } // GetType returns the event type. diff --git a/vendor/github.com/veandco/go-sdl2/sdl/gamecontroller.go b/vendor/github.com/veandco/go-sdl2/sdl/gamecontroller.go index 17ea5cb..6f68cea 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/gamecontroller.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/gamecontroller.go @@ -13,12 +13,18 @@ static SDL_GameController* SDL_GameControllerFromInstanceID(SDL_JoystickID joyid { return NULL; } + #endif + #if !(SDL_VERSION_ATLEAST(2,0,6)) #if defined(WARN_OUTDATED) #pragma message("SDL_GameControllerGetVendor is not supported before SDL 2.0.6") +#pragma message("SDL_GameControllerGetProduct is not supported before SDL 2.0.6") +#pragma message("SDL_GameControllerGetProductVersion is not supported before SDL 2.0.6") +#pragma message("SDL_GameControllerNumMappings is not supported before SDL 2.0.6") +#pragma message("SDL_GameControllerMappingForIndex is not supported before SDL 2.0.6") #endif static Uint16 SDL_GameControllerGetVendor(SDL_GameController* gamecontroller) @@ -27,71 +33,237 @@ static Uint16 SDL_GameControllerGetVendor(SDL_GameController* gamecontroller) } -#if defined(WARN_OUTDATED) -#pragma message("SDL_GameControllerGetProduct is not supported before SDL 2.0.6") -#endif - static Uint16 SDL_GameControllerGetProduct(SDL_GameController* gamecontroller) { return 0; } - -#if defined(WARN_OUTDATED) -#pragma message("SDL_GameControllerGetProductVersion is not supported before SDL 2.0.6") -#endif - static Uint16 SDL_GameControllerGetProductVersion(SDL_GameController* gamecontroller) { return 0; } +static int SDL_GameControllerNumMappings(void) +{ + return 0; +} + +static char* SDL_GameControllerMappingForIndex(int mapping_index) +{ + return NULL; +} +#endif + + +#if !(SDL_VERSION_ATLEAST(2,0,9)) #if defined(WARN_OUTDATED) -#pragma message("SDL_GameControllerNumMappings is not supported before SDL 2.0.6") +#pragma message("SDL_GameControllerGetPlayerIndex is not supported before SDL 2.0.9") +#pragma message("SDL_GameControllerRumble is not supported before SDL 2.0.9") +#pragma message("SDL_GameControllerMappingForDeviceIndex is not supported before SDL 2.0.9") #endif -static int SDL_GameControllerNumMappings(void) +typedef enum { - return 0; + SDL_SENSOR_INVALID = -1, + SDL_SENSOR_UNKNOWN, + SDL_SENSOR_ACCEL, + SDL_SENSOR_GYRO +} SDL_SensorType; + +static int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller) +{ + return -1; } +static int SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) +{ + return -1; +} + +static char *SDL_GameControllerMappingForDeviceIndex(int joystick_index) +{ + return NULL; +} + +#endif + + +#if !(SDL_VERSION_ATLEAST(2,0,12)) + +typedef enum +{ + SDL_CONTROLLER_TYPE_UNKNOWN = 0, + SDL_CONTROLLER_TYPE_XBOX360, + SDL_CONTROLLER_TYPE_XBOXONE, + SDL_CONTROLLER_TYPE_PS3, + SDL_CONTROLLER_TYPE_PS4, + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO +} SDL_GameControllerType; #if defined(WARN_OUTDATED) -#pragma message("SDL_GameControllerMappingForIndex is not supported before SDL 2.0.6") +#pragma message("SDL_GameControllerTypeForIndex is not supported before SDL 2.0.12") +#pragma message("SDL_GameControllerGetType is not supported before SDL 2.0.12") +#pragma message("SDL_GameControllerFromPlayerIndex is not supported before SDL 2.0.12") +#pragma message("SDL_GameControllerSetPlayerIndex is not supported before SDL 2.0.12") #endif -static char* SDL_GameControllerMappingForIndex(int mapping_index) +static SDL_GameControllerType SDL_GameControllerTypeForIndex(int joystick_index) +{ + return SDL_CONTROLLER_TYPE_UNKNOWN; +} + +static SDL_GameControllerType SDL_GameControllerGetType(SDL_GameController *gamecontroller) +{ + return SDL_CONTROLLER_TYPE_UNKNOWN; +} + +static SDL_GameController * SDL_GameControllerFromPlayerIndex(int player_index) { return NULL; } + +static void SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index) +{ + // do nothing +} + #endif -#if !(SDL_VERSION_ATLEAST(2,0,9)) + +#if !(SDL_VERSION_ATLEAST(2,0,14)) + +#define SDL_CONTROLLER_TYPE_VIRTUAL (6) +#define SDL_CONTROLLER_TYPE_PS5 (7) #if defined(WARN_OUTDATED) -#pragma message("SDL_GameControllerGetPlayerIndex is not supported before SDL 2.0.9") +#pragma message("SDL_GameControllerGetSerial is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerHasAxis is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerHasButton is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerGetNumTouchpads is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerGetNumTouchpadFingers is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerGetTouchpadFinger is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerHasSensor is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerSetSensorEnabled is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerIsSensorEnabled is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerGetSensorData is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerRumbleTriggers is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerHasLED is not supported before SDL 2.0.14") +#pragma message("SDL_GameControllerSetLED is not supported before SDL 2.0.14") #endif -static int SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller) +static const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller) +{ + return NULL; +} + +static SDL_bool SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) +{ + return SDL_FALSE; +} + +static SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) +{ + return SDL_FALSE; +} + +static int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller) +{ + return 0; +} + +static int SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad) +{ + return 0; +} + +static int SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure) +{ + return -1; +} + +static SDL_bool SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type) +{ + return SDL_FALSE; +} + +static int SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled) +{ + return -1; +} + +static SDL_bool SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type) +{ + return SDL_FALSE; +} + +static int SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values) +{ + return -1; +} + +static int SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms) +{ + return -1; +} + +static SDL_bool SDL_GameControllerHasLED(SDL_GameController *gamecontroller) +{ + return SDL_FALSE; +} + +static int SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue) { return -1; } +#endif + + +#if !(SDL_VERSION_ATLEAST(2,0,16)) + #if defined(WARN_OUTDATED) -#pragma message("SDL_GameControllerRumble is not supported before SDL 2.0.9") +#pragma message("SDL_GameControllerSendEffect is not supported before SDL 2.0.16") +#pragma message("SDL_GameControllerGetSensorDataRate is not supported before SDL 2.0.16") #endif -static int SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) +static int SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size) { return -1; } +static float SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type) +{ + return 0.0f; +} + +#endif + +#if !(SDL_VERSION_ATLEAST(2,0,18)) + #if defined(WARN_OUTDATED) -#pragma message("SDL_GameControllerMappingForDeviceIndex is not supported before SDL 2.0.9") +#pragma message("SDL_GameControllerHasRumble is not supported before SDL 2.0.18") +#pragma message("SDL_GameControllerHasRumbleTriggers is not supported before SDL 2.0.18") +#pragma message("SDL_GameControllerGetAppleSFSymbolsNameForButton is not supported before SDL 2.0.18") +#pragma message("SDL_GameControllerGetAppleSFSymbolsNameForAxis is not supported before SDL 2.0.18") #endif -static char *SDL_GameControllerMappingForDeviceIndex(int joystick_index) +static SDL_bool SDL_GameControllerHasRumble(SDL_GameController *gamecontroller) +{ + return SDL_FALSE; +} + +static SDL_bool SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller) +{ + return SDL_FALSE; +} + +static const char* SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button) +{ + return NULL; +} + +static const char* SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis) { return NULL; } @@ -99,8 +271,10 @@ static char *SDL_GameControllerMappingForDeviceIndex(int joystick_index) #endif */ import "C" -import "unsafe" -import "encoding/binary" +import ( + "encoding/binary" + "unsafe" +) // Types of game controller inputs. const ( @@ -392,3 +566,46 @@ func (bind *GameControllerButtonBind) HatMask() int { val, _ := binary.Varint(bind.value[4:8]) return int(val) } + +// SendEffect sends a controller specific effect packet. +// (https://wiki.libsdl.org/SDL_GameControllerSendEffect) +func (ctrl *GameController) SendEffect(data []byte) (err error) { + _size := C.int(len(data)) + return errorFromInt(int(C.SDL_GameControllerSendEffect(ctrl.cptr(), unsafe.Pointer(&data[0]), _size))) +} + +// GetSensorDataRate gets the data rate (number of events per second) of a game controller sensor. +// (https://wiki.libsdl.org/SDL_GameControllerGetSensorDataRate) +func (ctrl *GameController) SensorDataRate(typ SensorType) (rate float32) { + return float32(C.SDL_GameControllerGetSensorDataRate(ctrl.cptr(), C.SDL_SensorType(typ))) +} + +// HasRumble queries whether a game controller has rumble support. +// (https://wiki.libsdl.org/SDL_GameControllerHasRumble) +func (ctrl *GameController) HasRumble() bool { + return C.SDL_GameControllerHasRumble(ctrl.cptr()) == C.SDL_TRUE +} + +// HasRumbleTriggers queries whether a game controller has rumble support on triggers. +// (https://wiki.libsdl.org/SDL_GameControllerHasRumbleTriggers) +func (ctrl *GameController) HasRumbleTriggers() bool { + return C.SDL_GameControllerHasRumbleTriggers(ctrl.cptr()) == C.SDL_TRUE +} + +// GetAppleSFSymbolsNameForButton returns the sfSymbolsName for a given button on a game controller on Apple platforms. +// (https://wiki.libsdl.org/SDL_GameControllerGetAppleSFSymbolsNameForButton) +func (ctrl *GameController) GetAppleSFSymbolsNameForButton(button GameControllerButton) (sfSymbolsName string) { + _button := C.SDL_GameControllerButton(button) + _sfSymbolsName := C.SDL_GameControllerGetAppleSFSymbolsNameForButton(ctrl.cptr(), _button) + sfSymbolsName = C.GoString(_sfSymbolsName) + return +} + +// GetAppleSFSymbolsNameForAxis returns the sfSymbolsName for a given axis on a game controller on Apple platforms. +// (https://wiki.libsdl.org/SDL_GameControllerGetAppleSFSymbolsNameForAxis) +func (ctrl *GameController) SDL_GameControllerGetAppleSFSymbolsNameForAxis(axis GameControllerAxis) (sfSymbolsName string) { + _axis := C.SDL_GameControllerAxis(axis) + _sfSymbolsName := C.SDL_GameControllerGetAppleSFSymbolsNameForAxis(ctrl.cptr(), _axis) + sfSymbolsName = C.GoString(_sfSymbolsName) + return +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/guid.go b/vendor/github.com/veandco/go-sdl2/sdl/guid.go new file mode 100644 index 0000000..034ba82 --- /dev/null +++ b/vendor/github.com/veandco/go-sdl2/sdl/guid.go @@ -0,0 +1,48 @@ +package sdl + +/* +#include "sdl_wrapper.h" + +#if !SDL_VERSION_ATLEAST(2,24,0) +#if defined(WARN_OUTDATED) +#pragma message("SDL_GUIDToString is not supported before SDL 2.24.0") +#pragma message("SDL_GUIDFromString is not supported before SDL 2.24.0") +#endif + +typedef struct { + Uint8 data[16]; +} SDL_GUID; + +static inline void SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID) +{ + return; +} + +static inline SDL_GUID SDL_GUIDFromString(const char *pchGUID) +{ + SDL_GUID guid; + return guid; +} +#endif +*/ +import "C" +import ( + "unsafe" +) + +type GUID C.SDL_GUID + +// ToString returns an ASCII string representation for a given GUID. +func (guid GUID) ToString() (ascii string) { + _cap := C.size_t(33) + _buf := (*C.char)(C.SDL_malloc(_cap)) + defer C.SDL_free(unsafe.Pointer(_buf)) + C.SDL_GUIDToString(C.SDL_GUID(guid), _buf, C.int(_cap)) + return C.GoString(_buf) +} + +// GUIDFromString converts a GUID string into a GUID structure. +func GUIDFromString(ascii string) (guid GUID) { + _ascii := C.CString(ascii) + return GUID(C.SDL_GUIDFromString(_ascii)) +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/hidapi.go b/vendor/github.com/veandco/go-sdl2/sdl/hidapi.go new file mode 100644 index 0000000..6bfa7a4 --- /dev/null +++ b/vendor/github.com/veandco/go-sdl2/sdl/hidapi.go @@ -0,0 +1,358 @@ +package sdl + +/* +#include "sdl_wrapper.h" + +#if !(SDL_VERSION_ATLEAST(2,0,18)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_hid_init is not supported before SDL 2.0.18") +#pragma message("SDL_hid_exit is not supported before SDL 2.0.18") +#pragma message("SDL_hid_device_change_count is not supported before SDL 2.0.18") +#pragma message("SDL_hid_enumerate is not supported before SDL 2.0.18") +#pragma message("SDL_hid_free_enumeration is not supported before SDL 2.0.18") +#pragma message("SDL_hid_open is not supported before SDL 2.0.18") +#pragma message("SDL_hid_open_path is not supported before SDL 2.0.18") +#pragma message("SDL_hid_write is not supported before SDL 2.0.18") +#pragma message("SDL_hid_read_timeout is not supported before SDL 2.0.18") +#pragma message("SDL_hid_read is not supported before SDL 2.0.18") +#pragma message("SDL_hid_set_nonblocking is not supported before SDL 2.0.18") +#pragma message("SDL_hid_send_feature_report is not supported before SDL 2.0.18") +#pragma message("SDL_hid_get_feature_report is not supported before SDL 2.0.18") +#pragma message("SDL_hid_close is not supported before SDL 2.0.18") +#pragma message("SDL_hid_get_manufacturer_string is not supported before SDL 2.0.18") +#pragma message("SDL_hid_get_product_string is not supported before SDL 2.0.18") +#pragma message("SDL_hid_get_serial_number_string is not supported before SDL 2.0.18") +#pragma message("SDL_hid_get_indexed_string is not supported before SDL 2.0.18") +#pragma message("SDL_hid_ble_scan is not supported before SDL 2.0.18") +#endif + +struct SDL_hid_device_; +typedef struct SDL_hid_device_ SDL_hid_device; // opaque hidapi structure + +// hidapi info structure +// Information about a connected HID device +typedef struct SDL_hid_device_info +{ + // Platform-specific device path + char *path; + + // Device Vendor ID + unsigned short vendor_id; + + // Device Product ID + unsigned short product_id; + + // Serial Number + wchar_t *serial_number; + + // Device Release Number in binary-coded decimal, also known as Device Version Number + unsigned short release_number; + + // Manufacturer String + wchar_t *manufacturer_string; + + // Product string + wchar_t *product_string; + + // Usage Page for this Device/Interface (Windows/Mac only). + unsigned short usage_page; + + // Usage for this Device/Interface (Windows/Mac only). + unsigned short usage; + + // The USB interface which this logical device represents. + // Valid on both Linux implementations in all cases. + // Valid on the Windows implementation only if the device + // contains more than one interface. + int interface_number; + + // Additional information about the USB interface. + // Valid on libusb and Android implementations. + int interface_class; + int interface_subclass; + int interface_protocol; + + // Pointer to the next device + struct SDL_hid_device_info *next; +} SDL_hid_device_info; + +static int SDL_hid_init(void) +{ + return -1; +} + +static int SDL_hid_exit(void) +{ + return -1; +} + +static Uint32 SDL_hid_device_change_count(void) +{ + return 0; +} + +static SDL_hid_device_info * SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id) +{ + return NULL; +} + +static void SDL_hid_free_enumeration(SDL_hid_device_info *devs) +{ +} + +static SDL_hid_device * SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number) +{ + return NULL; +} + +static SDL_hid_device * SDL_hid_open_path(const char *path, int bExclusive) +{ + return NULL; +} + +static int SDL_hid_write(SDL_hid_device *dev, const unsigned char *data, size_t length) +{ + return -1; +} + +static int SDL_hid_read_timeout(SDL_hid_device *dev, unsigned char *data, size_t length, int milliseconds) +{ + return -1; +} + +static int SDL_hid_read(SDL_hid_device *dev, unsigned char *data, size_t length) +{ + return -1; +} + +static int SDL_hid_set_nonblocking(SDL_hid_device *dev, int nonblock) +{ + return -1; +} + +static int SDL_hid_send_feature_report(SDL_hid_device *dev, const unsigned char *data, size_t length) +{ + return -1; +} + +static int SDL_hid_get_feature_report(SDL_hid_device *dev, unsigned char *data, size_t length) +{ + return -1; +} + +static void SDL_hid_close(SDL_hid_device *dev) +{ +} + +static int SDL_hid_get_manufacturer_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen) +{ + return -1; +} + +static int SDL_hid_get_product_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen) +{ + return -1; +} + +static int SDL_hid_get_serial_number_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen) +{ + return -1; +} + +static int SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen) +{ + return -1; +} + +static void SDL_hid_ble_scan(SDL_bool active) +{ +} + +#endif +*/ +import "C" +import "unsafe" + +type HIDDevice C.SDL_hid_device + +type HIDDeviceInfo struct { + path *C.char + VendorID uint16 + ProductID uint16 + SerialNumber *C.wchar_t + ReleaseNumber uint16 + ManufacturerString *C.wchar_t + ProductString *C.wchar_t + UsagePage uint16 + Usage uint16 + InterfaceNumber int32 + InterfaceClass int32 + InterfaceSubclass int32 + InterfaceProtocol int32 + next *HIDDeviceInfo +} + +func (info *HIDDeviceInfo) Path() string { + return C.GoString(info.path) +} + +// HIDInit initializes the HIDAPI library. +// (https://wiki.libsdl.org/SDL_hid_init) +func HIDInit() (err error) { + ret := C.SDL_hid_init() + return errorFromInt(int(ret)) +} + +// HIDExit finalizes the HIDAPI library. +// (https://wiki.libsdl.org/SDL_hid_exit) +func HIDExit() (err error) { + ret := C.SDL_hid_exit() + return errorFromInt(int(ret)) +} + +// HIDDeviceChangeCount checks to see if devices may have been added or removed. +// (https://wiki.libsdl.org/SDL_hid_device_change_count) +func HIDDeviceChangeCount() (n uint32) { + return uint32(C.SDL_hid_device_change_count()) +} + +// HIDEnumerate enumerates the HID devices. +// (https://wiki.libsdl.org/SDL_hid_enumerate) +func HIDEnumerate(vendorID, productID uint16) (info *HIDDeviceInfo) { + _vendorID := C.Uint16(vendorID) + _productID := C.Uint16(productID) + info = (*HIDDeviceInfo)(unsafe.Pointer(C.SDL_hid_enumerate(_vendorID, _productID))) + return +} + +// HIDFreeEnumeration frees an enumeration Linked List. +// (https://wiki.libsdl.org/SDL_hid_free_enumeration) +func HIDFreeEnumeration(info *HIDDeviceInfo) { + _info := (*C.SDL_hid_device_info)(unsafe.Pointer(info)) + C.SDL_hid_free_enumeration(_info) +} + +// HIDOpen opens a HID device using a Vendor ID (VID), Product ID (PID) and optionally a serial number. +// (https://wiki.libsdl.org/SDL_hid_open) +func HIDOpen(vendorID, productID uint16, _serialNumber *C.wchar_t) (device *HIDDevice) { + _vendorID := C.Uint16(vendorID) + _productID := C.Uint16(productID) + _device := C.SDL_hid_open(_vendorID, _productID, _serialNumber) + return (*HIDDevice)(_device) +} + +// HIDOpenPath opens a HID device by its path name. +// (https://wiki.libsdl.org/SDL_hid_open_path) +func HIDOpenPath(path string, exclusive bool) (device *HIDDevice) { + _path := C.CString(path) + defer C.free(unsafe.Pointer(_path)) + _exclusive := C.int(0) + if exclusive { + _exclusive = C.int(1) + } + _device := C.SDL_hid_open_path(_path, _exclusive) + return (*HIDDevice)(_device) +} + +// Write writes an Output report to a HID device. +// (https://wiki.libsdl.org/SDL_hid_write) +func (device *HIDDevice) Write(data []byte) (n int, err error) { + _length := C.size_t(len(data)) + _data := (*C.uchar)(unsafe.Pointer(&data[0])) + _device := (*C.SDL_hid_device)(device) + n = int(C.SDL_hid_write(_device, _data, _length)) + return n, errorFromInt(n) +} + +// ReadTimeout reads an Input report from a HID device with timeout. +// (https://wiki.libsdl.org/SDL_hid_read_timeout) +func (device *HIDDevice) ReadTimeout(data []byte, milliseconds int) (n int, err error) { + _length := C.size_t(len(data)) + _data := (*C.uchar)(unsafe.Pointer(&data[0])) + _device := (*C.SDL_hid_device)(device) + _milliseconds := C.int(milliseconds) + n = int(C.SDL_hid_read_timeout(_device, _data, _length, _milliseconds)) + return n, errorFromInt(n) +} + +// Read an Input report from a HID device. +// (https://wiki.libsdl.org/SDL_hid_read) +func (device *HIDDevice) Read(data []byte) (n int, err error) { + _length := C.size_t(len(data)) + _data := (*C.uchar)(unsafe.Pointer(&data[0])) + _device := (*C.SDL_hid_device)(device) + n = int(C.SDL_hid_read(_device, _data, _length)) + return n, errorFromInt(n) +} + +// SetNonBlocking sets the device handle to be non-blocking. +// (https://wiki.libsdl.org/SDL_hid_set_nonblocking) +func (device *HIDDevice) SetNonBlocking(nonblock bool) (err error) { + _device := (*C.SDL_hid_device)(device) + _nonblock := C.int(Btoi(nonblock)) + return errorFromInt(int(C.SDL_hid_set_nonblocking(_device, _nonblock))) +} + +// SendFeatureReport sends a Feature report to the device. +// (https://wiki.libsdl.org/SDL_hid_send_feature_report) +func (device *HIDDevice) SendFeatureReport(data []byte) (n int, err error) { + _length := C.size_t(len(data)) + _data := (*C.uchar)(unsafe.Pointer(&data[0])) + _device := (*C.SDL_hid_device)(device) + n = int(C.SDL_hid_send_feature_report(_device, _data, _length)) + return n, errorFromInt(n) +} + +// GetFeatureReport gets a feature report from a HID device. +// (https://wiki.libsdl.org/SDL_hid_get_feature_report) +func (device *HIDDevice) GetFeatureReport(data []byte) (n int, err error) { + _length := C.size_t(len(data)) + _data := (*C.uchar)(unsafe.Pointer(&data[0])) + _device := (*C.SDL_hid_device)(device) + n = int(C.SDL_hid_get_feature_report(_device, _data, _length)) + return n, errorFromInt(n) +} + +// Close closes a HID device. +// (https://wiki.libsdl.org/SDL_hid_close) +func (device *HIDDevice) Close() { + _device := (*C.SDL_hid_device)(device) + C.SDL_hid_close(_device) +} + +// GetManufacturerString gets The Manufacturer String from a HID device. +// (https://wiki.libsdl.org/SDL_hid_get_manufacturer_string) +func (device *HIDDevice) GetManufacturerString(_str *C.wchar_t, _maxlen C.size_t) (err error) { + _device := (*C.SDL_hid_device)(device) + return errorFromInt(int(C.SDL_hid_get_manufacturer_string(_device, _str, _maxlen))) +} + +// GetProductString gets The Product String from a HID device. +// (https://wiki.libsdl.org/SDL_hid_get_product_string) +func (device *HIDDevice) GetProductString(_str *C.wchar_t, _maxlen C.size_t) (err error) { + _device := (*C.SDL_hid_device)(device) + return errorFromInt(int(C.SDL_hid_get_product_string(_device, _str, _maxlen))) +} + +// GetSerialNumberString gets The SerialNumber String from a HID device. +// (https://wiki.libsdl.org/SDL_hid_get_serial_number_string) +func (device *HIDDevice) GetSerialNumberString(_str *C.wchar_t, _maxlen C.size_t) (err error) { + _device := (*C.SDL_hid_device)(device) + return errorFromInt(int(C.SDL_hid_get_serial_number_string(_device, _str, _maxlen))) +} + +// GetIndexedString gets a string from a HID device, based on its string index. +// (https://wiki.libsdl.org/SDL_hid_get_indexed_string) +func (device *HIDDevice) GetIndexedString(index int, _str *C.wchar_t, _maxlen C.size_t) (err error) { + _device := (*C.SDL_hid_device)(device) + _index := C.int(index) + return errorFromInt(int(C.SDL_hid_get_indexed_string(_device, _index, _str, _maxlen))) +} + +// HIDBLEScan starts or stops a BLE scan on iOS and tvOS to pair Steam Controllers. +// (https://wiki.libsdl.org/SDL_hid_ble_scan) +func (device *HIDDevice) HIDBLEScan(active bool) { + _active := C.SDL_bool(Btoi(active)) + C.SDL_hid_ble_scan(_active) +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/hints.go b/vendor/github.com/veandco/go-sdl2/sdl/hints.go index c7a7269..1b88ee4 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/hints.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/hints.go @@ -4,8 +4,18 @@ package sdl #include "sdl_wrapper.h" #include "hints.h" +#if !(SDL_VERSION_ATLEAST(2,0,20)) +#define SDL_HINT_RENDER_LINE_METHOD "" +#endif + +#if !(SDL_VERSION_ATLEAST(2,0,18)) +#define SDL_HINT_APP_NAME "" +#endif + #if !(SDL_VERSION_ATLEAST(2,0,16)) #define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "" +#define SDL_HINT_AUDIO_INCLUDE_MONITORS "" +#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "" #endif #if !(SDL_VERSION_ATLEAST(2,0,14)) @@ -35,6 +45,7 @@ package sdl #if !(SDL_VERSION_ATLEAST(2,0,9)) #define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "" #define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "" +#define SDL_HINT_JOYSTICK_HIDAPI_STEAM "" #endif #if !(SDL_VERSION_ATLEAST(2,0,8)) @@ -93,11 +104,21 @@ package sdl #endif #if !(SDL_VERSION_ATLEAST(2,0,10)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH has been removed in SDL 2.0.10") +#endif + #define SDL_HINT_RENDER_BATCHING "" #define SDL_HINT_EVENT_LOGGING "" #define SDL_HINT_GAMECONTROLLERCONFIG_FILE "" #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "" #define SDL_HINT_MOUSE_TOUCH_EVENTS "" + +#else + +#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH "" // For compatibility + #endif #if SDL_VERSION_ATLEAST(2,0,16) @@ -110,13 +131,27 @@ package sdl #endif -#if SDL_VERSION_ATLEAST(2,0,10) +#if !SDL_VERSION_ATLEAST(2,0,18) + +#define SDL_HINT_IME_SHOW_UI "" +#define SDL_HINT_JOYSTICK_DEVICE "" +#define SDL_HINT_LINUX_JOYSTICK_CLASSIC "" +#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME "" +#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY "" -#if defined(WARN_OUTDATED) -#pragma message("SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH has been removed in SDL 2.0.10") #endif -#define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH "" // For compatibility +#if !SDL_VERSION_ATLEAST(2,0,22) + +#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT "" +#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "" +#define SDL_HINT_MOUSE_AUTO_CAPTURE "" +#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL "" +#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN "" +#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE "" +#define SDL_HINT_JOYSTICK_ROG_CHAKRAM "" +#define SDL_HINT_X11_WINDOW_TYPE "" +#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR "" #endif */ @@ -206,6 +241,25 @@ const ( HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL = C.SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL // Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime. HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO = C.SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO // A variable to control whether SDL will pause audio in background (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking"). HINT_EMSCRIPTEN_ASYNCIFY = C.SDL_HINT_EMSCRIPTEN_ASYNCIFY // Disable giving back control to the browser automatically when running with asyncify. + HINT_AUDIO_INCLUDE_MONITORS = C.SDL_HINT_AUDIO_INCLUDE_MONITORS // Control whether PulseAudio recording should include monitor devices + HINT_AUDIO_DEVICE_STREAM_ROLE = C.SDL_HINT_AUDIO_DEVICE_STREAM_ROLE // Describe the role of your application for audio control panels + HINT_APP_NAME = C.SDL_HINT_APP_NAME // Lets you specify the application name sent to the OS when required + HINT_VIDEO_EGL_ALLOW_TRANSPARENCY = C.SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY // A variable controlling whether the EGL window is allowed to be composited as transparent, rather than opaque + HINT_IME_SHOW_UI = C.SDL_HINT_IME_SHOW_UI // A variable to control whether certain IMEs should show native UI components (such as the Candidate List) instead of suppressing them + HINT_IME_SUPPORT_EXTENDED_TEXT = C.SDL_HINT_IME_SUPPORT_EXTENDED_TEXT // A variable to control if extended IME text support is enabled. + HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME = C.SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME // This hint lets you specify the "activity name" sent to the OS when SDL_DisableScreenSaver() is used (or the screensaver is automatically disabled) + HINT_LINUX_JOYSTICK_CLASSIC = C.SDL_HINT_LINUX_JOYSTICK_CLASSIC // A variable controlling whether to use the classic /dev/input/js* joystick interface or the newer /dev/input/event* joystick interface on Linux + HINT_JOYSTICK_DEVICE = C.SDL_HINT_JOYSTICK_DEVICE // This variable is currently only used by the Linux joystick driver + HINT_JOYSTICK_HIDAPI_STEAM = C.SDL_HINT_JOYSTICK_HIDAPI_STEAM // A variable controlling whether the HIDAPI driver for Steam Controllers should be used + HINT_RENDER_LINE_METHOD = C.SDL_HINT_RENDER_LINE_METHOD // A variable controlling how the 2D render API renders lines + HINT_MOUSE_RELATIVE_MODE_CENTER = C.SDL_HINT_MOUSE_RELATIVE_MODE_CENTER // A variable controlling whether relative mouse mode constrains the mouse to the center of the window + HINT_MOUSE_AUTO_CAPTURE = C.SDL_HINT_MOUSE_AUTO_CAPTURE // A variable controlling whether the mouse is captured while mouse buttons are pressed + HINT_VIDEO_FOREIGN_WINDOW_OPENGL = C.SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL // When calling SDL_CreateWindowFrom(), make the window compatible with OpenGL + HINT_VIDEO_FOREIGN_WINDOW_VULKAN = C.SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN // When calling SDL_CreateWindowFrom(), make the window compatible with Vulkan + HINT_QUIT_ON_LAST_WINDOW_CLOSE = C.SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE // A variable that decides whether to send SDL_QUIT when closing the final window + HINT_JOYSTICK_ROG_CHAKRAM = C.SDL_HINT_JOYSTICK_ROG_CHAKRAM // A variable controlling whether the ROG Chakram mice should show up as joysticks + HINT_X11_WINDOW_TYPE = C.SDL_HINT_X11_WINDOW_TYPE // A variable that forces X11 windows to create as a custom type + HINT_VIDEO_WAYLAND_PREFER_LIBDECOR = C.SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR // A variable controlling whether the libdecor Wayland backend is preferred over native decrations ) // An enumeration of hint priorities. diff --git a/vendor/github.com/veandco/go-sdl2/sdl/joystick.go b/vendor/github.com/veandco/go-sdl2/sdl/joystick.go index 7c16631..a1fb950 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/joystick.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/joystick.go @@ -214,6 +214,25 @@ static int SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumbl return -1; } +#endif + +#if !(SDL_VERSION_ATLEAST(2,0,18)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_JoystickHasRumble is not supported before SDL 2.0.18") +#pragma message("SDL_JoystickHasRumbleTriggers is not supported before SDL 2.0.18") +#endif + +static SDL_bool SDL_JoystickHasRumble(SDL_Joystick *joystick) +{ + return SDL_FALSE; +} + +static SDL_bool SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick) +{ + return SDL_FALSE; +} + #endif */ import "C" @@ -520,3 +539,15 @@ func (joy *Joystick) Close() { func (joy *Joystick) CurrentPowerLevel() JoystickPowerLevel { return JoystickPowerLevel(C.SDL_JoystickCurrentPowerLevel(joy.cptr())) } + +// HasRumble queries whether a game controller has rumble support. +// (https://wiki.libsdl.org/SDL_JoystickHasRumble) +func (ctrl *Joystick) HasRumble() bool { + return C.SDL_JoystickHasRumble(ctrl.cptr()) == C.SDL_TRUE +} + +// HasRumbleTriggers queries whether a game controller has rumble support on triggers. +// (https://wiki.libsdl.org/SDL_JoystickHasRumbleTriggers) +func (ctrl *Joystick) HasRumbleTriggers() bool { + return C.SDL_JoystickHasRumbleTriggers(ctrl.cptr()) == C.SDL_TRUE +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/keyboard.go b/vendor/github.com/veandco/go-sdl2/sdl/keyboard.go index 917a836..f1579da 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/keyboard.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/keyboard.go @@ -1,9 +1,31 @@ package sdl -// #include "sdl_wrapper.h" +/* +#include "sdl_wrapper.h" + +#if !(SDL_VERSION_ATLEAST(2,0,22)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_IsTextInputShown is not supported before SDL 2.0.22") +#pragma message("SDL_ClearComposition is not supported before SDL 2.0.22") +#endif + +static inline SDL_bool SDL_IsTextInputShown(void) +{ + return SDL_FALSE; +} + +static inline void SDL_ClearComposition(void) +{ +} + +#endif +*/ import "C" -import "unsafe" -import "reflect" +import ( + "reflect" + "unsafe" +) // Keysym contains key information used in key events. // (https://wiki.libsdl.org/SDL_Keysym) @@ -119,3 +141,15 @@ func HasScreenKeyboardSupport() bool { func IsScreenKeyboardShown(window *Window) bool { return C.SDL_IsScreenKeyboardShown(window.cptr()) > 0 } + +// IsTextInputShown returns if an IME Composite or Candidate window is currently shown. +// (https://wiki.libsdl.org/SDL_IsTextInputShown) +func IsTextInputShown() bool { + return C.SDL_IsTextInputShown() > 0 +} + +// ClearComposition dismisses the composition window/IME without disabling the subsystem. +// (https://wiki.libsdl.org/SDL_ClearComposition) +func ClearComposition() { + C.SDL_ClearComposition() +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/pixels.go b/vendor/github.com/veandco/go-sdl2/sdl/pixels.go index fb4d7f9..81f08af 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/pixels.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/pixels.go @@ -71,7 +71,7 @@ type cPalette C.SDL_Palette // Color represents a color. This implements image/color.Color interface. // (https://wiki.libsdl.org/SDL_Color) -type Color color.RGBA +type Color color.NRGBA // Uint32 return uint32 representation of RGBA color. func (c Color) Uint32() uint32 { @@ -342,17 +342,6 @@ func BitsPerPixel(format uint32) int { return int(C.bitsPerPixel(C.Uint32(format))) } -type RGB444 struct { - R, G, B byte -} - -func (c RGB444) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 12 - g = uint32(c.G) << 12 - b = uint32(c.B) << 12 - return -} - var ( RGB444Model color.Model = color.ModelFunc(rgb444Model) RGB332Model color.Model = color.ModelFunc(rgb332Model) @@ -372,12 +361,30 @@ var ( BGRA8888Model color.Model = color.ModelFunc(bgra8888Model) ) +type RGB444 struct { + R, G, B byte +} + +func (c RGB444) RGBA() (r, g, b, a uint32) { + nrgba := color.NRGBA{ + R: upscale4to8bit(c.R), + G: upscale4to8bit(c.G), + B: upscale4to8bit(c.B), + A: 0xFF, + } + return nrgba.RGBA() +} + func rgb444Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(RGB444); ok { return c } - r, g, b, _ := c.RGBA() - return RGB444{uint8(r >> 12), uint8(g >> 12), uint8(b >> 12)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return RGB444{ + R: downscale8to4bit(nrgba.R), + G: downscale8to4bit(nrgba.G), + B: downscale8to4bit(nrgba.B), + } } type RGB332 struct { @@ -385,18 +392,25 @@ type RGB332 struct { } func (c RGB332) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 13 - g = uint32(c.G) << 13 - b = uint32(c.B) << 14 - return + nrgba := color.NRGBA{ + R: upscale3to8bit(c.R), + G: upscale3to8bit(c.G), + B: upscale2to8bit(c.B), + A: 0xFF, + } + return nrgba.RGBA() } func rgb332Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(RGB332); ok { return c } - r, g, b, _ := c.RGBA() - return RGB332{uint8(r >> 13), uint8(g >> 13), uint8(b >> 14)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return RGB332{ + R: downscale8to3bit(nrgba.R), + G: downscale8to3bit(nrgba.G), + B: downscale8to2bit(nrgba.B), + } } type RGB565 struct { @@ -404,18 +418,25 @@ type RGB565 struct { } func (c RGB565) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 11 - g = uint32(c.G) << 10 - b = uint32(c.B) << 11 - return + nrgba := color.NRGBA{ + R: upscale5to8bit(c.R), + G: upscale6to8bit(c.G), + B: upscale5to8bit(c.B), + A: 0xFF, + } + return nrgba.RGBA() } func rgb565Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(RGB565); ok { return c } - r, g, b, _ := c.RGBA() - return RGB565{uint8(r >> 11), uint8(g >> 10), uint8(b >> 11)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return RGB565{ + R: downscale8to5bit(nrgba.R), + G: downscale8to6bit(nrgba.G), + B: downscale8to5bit(nrgba.B), + } } type RGB555 struct { @@ -423,18 +444,25 @@ type RGB555 struct { } func (c RGB555) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 11 - g = uint32(c.G) << 11 - b = uint32(c.B) << 11 - return + nrgba := color.NRGBA{ + R: upscale5to8bit(c.R), + G: upscale5to8bit(c.G), + B: upscale5to8bit(c.B), + A: 0xFF, + } + return nrgba.RGBA() } func rgb555Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(RGB555); ok { return c } - r, g, b, _ := c.RGBA() - return RGB555{uint8(r >> 11), uint8(g >> 11), uint8(b >> 11)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return RGB555{ + R: downscale8to5bit(nrgba.R), + G: downscale8to5bit(nrgba.G), + B: downscale8to5bit(nrgba.B), + } } type BGR565 struct { @@ -442,18 +470,25 @@ type BGR565 struct { } func (c BGR565) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 11 - g = uint32(c.G) << 10 - b = uint32(c.B) << 11 - return + nrgba := color.NRGBA{ + R: upscale5to8bit(c.R), + G: upscale6to8bit(c.G), + B: upscale5to8bit(c.B), + A: 0xFF, + } + return nrgba.RGBA() } func bgr565Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(BGR565); ok { return c } - r, g, b, _ := c.RGBA() - return BGR565{uint8(b >> 11), uint8(g >> 10), uint8(r >> 11)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return BGR565{ + B: downscale8to5bit(nrgba.B), + G: downscale8to6bit(nrgba.G), + R: downscale8to5bit(nrgba.R), + } } type BGR555 struct { @@ -461,18 +496,77 @@ type BGR555 struct { } func (c BGR555) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 11 - g = uint32(c.G) << 11 - b = uint32(c.B) << 11 - return + nrgba := color.NRGBA{ + R: upscale5to8bit(c.R), + G: upscale5to8bit(c.G), + B: upscale5to8bit(c.B), + A: 0xFF, + } + return nrgba.RGBA() } func bgr555Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(BGR555); ok { return c } - r, g, b, _ := c.RGBA() - return BGR555{uint8(b >> 11), uint8(g >> 11), uint8(r >> 11)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return BGR555{ + B: downscale8to5bit(nrgba.B), + G: downscale8to5bit(nrgba.G), + R: downscale8to5bit(nrgba.R), + } +} + +type RGB888 struct { + R, G, B byte +} + +func (c RGB888) RGBA() (r, g, b, a uint32) { + nrgba := color.NRGBA{ + R: c.R, + G: c.G, + B: c.B, + A: 0xFF, + } + return nrgba.RGBA() +} + +func rgb888Model(c color.Color) color.Color { + if _, ok := c.(RGB888); ok { + return c + } + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return RGB888{ + R: nrgba.R, + G: nrgba.G, + B: nrgba.B, + } +} + +type BGR888 struct { + B, G, R byte +} + +func (c BGR888) RGBA() (r, g, b, a uint32) { + nrgba := color.NRGBA{ + R: c.R, + G: c.G, + B: c.B, + A: 0xFF, + } + return nrgba.RGBA() +} + +func bgr888Model(c color.Color) color.Color { + if _, ok := c.(BGR888); ok { + return c + } + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return BGR888{ + B: nrgba.B, + G: nrgba.G, + R: nrgba.R, + } } type ARGB4444 struct { @@ -480,19 +574,26 @@ type ARGB4444 struct { } func (c ARGB4444) RGBA() (r, g, b, a uint32) { - a = uint32(c.A) << 4 - r = uint32(c.R) << 4 - g = uint32(c.G) << 4 - b = uint32(c.B) << 4 - return + nrgba := color.NRGBA{ + R: upscale4to8bit(c.R), + G: upscale4to8bit(c.G), + B: upscale4to8bit(c.B), + A: upscale4to8bit(c.A), + } + return nrgba.RGBA() } func argb4444Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(ARGB4444); ok { return c } - r, g, b, a := c.RGBA() - return ARGB4444{uint8(a >> 4), uint8(r >> 4), uint8(g >> 4), uint8(b >> 4)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return ARGB4444{ + A: downscale8to4bit(nrgba.A), + R: downscale8to4bit(nrgba.R), + G: downscale8to4bit(nrgba.G), + B: downscale8to4bit(nrgba.B), + } } type ABGR4444 struct { @@ -500,19 +601,26 @@ type ABGR4444 struct { } func (c ABGR4444) RGBA() (r, g, b, a uint32) { - a = uint32(c.A) << 4 - r = uint32(c.R) << 4 - g = uint32(c.G) << 4 - b = uint32(c.B) << 4 - return + nrgba := color.NRGBA{ + R: upscale4to8bit(c.R), + G: upscale4to8bit(c.G), + B: upscale4to8bit(c.B), + A: upscale4to8bit(c.A), + } + return nrgba.RGBA() } func abgr4444Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(ABGR4444); ok { return c } - r, g, b, a := c.RGBA() - return ABGR4444{uint8(a >> 4), uint8(b >> 4), uint8(g >> 4), uint8(r >> 4)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return ABGR4444{ + A: downscale8to4bit(nrgba.A), + B: downscale8to4bit(nrgba.B), + G: downscale8to4bit(nrgba.G), + R: downscale8to4bit(nrgba.R), + } } type RGBA4444 struct { @@ -520,19 +628,26 @@ type RGBA4444 struct { } func (c RGBA4444) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 4 - g = uint32(c.G) << 4 - b = uint32(c.B) << 4 - a = uint32(c.A) << 4 - return + nrgba := color.NRGBA{ + R: upscale4to8bit(c.R), + G: upscale4to8bit(c.G), + B: upscale4to8bit(c.B), + A: upscale4to8bit(c.A), + } + return nrgba.RGBA() } func rgba4444Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(RGBA4444); ok { return c } - r, g, b, a := c.RGBA() - return RGBA4444{uint8(r >> 4), uint8(g >> 4), uint8(b >> 4), uint8(a >> 4)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return RGBA4444{ + R: downscale8to4bit(nrgba.R), + G: downscale8to4bit(nrgba.G), + B: downscale8to4bit(nrgba.B), + A: downscale8to4bit(nrgba.A), + } } type BGRA4444 struct { @@ -540,19 +655,26 @@ type BGRA4444 struct { } func (c BGRA4444) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 4 - g = uint32(c.G) << 4 - b = uint32(c.B) << 4 - a = uint32(c.A) << 4 - return + nrgba := color.NRGBA{ + R: upscale4to8bit(c.R), + G: upscale4to8bit(c.G), + B: upscale4to8bit(c.B), + A: upscale4to8bit(c.A), + } + return nrgba.RGBA() } func bgra4444Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(BGRA4444); ok { return c } - r, g, b, a := c.RGBA() - return BGRA4444{uint8(b >> 4), uint8(g >> 4), uint8(r >> 4), uint8(a >> 4)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return BGRA4444{ + B: downscale8to4bit(nrgba.B), + G: downscale8to4bit(nrgba.G), + R: downscale8to4bit(nrgba.R), + A: downscale8to4bit(nrgba.A), + } } type ARGB1555 struct { @@ -560,27 +682,26 @@ type ARGB1555 struct { } func (c ARGB1555) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 3 - g = uint32(c.G) << 3 - b = uint32(c.B) << 3 - if c.A > 0 { - tmp := int32(-1) - a = uint32(tmp) + nrgba := color.NRGBA{ + R: upscale5to8bit(c.R), + G: upscale5to8bit(c.G), + B: upscale5to8bit(c.B), + A: upscale1to8bit(c.A), } - return + return nrgba.RGBA() } func argb1555Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(ARGB1555); ok { return c } - r, g, b, a := c.RGBA() - if a > 0 { - a = 1 - } else { - a = 0 + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return ARGB1555{ + A: downscale8to1bit(nrgba.A), + R: downscale8to5bit(nrgba.R), + G: downscale8to5bit(nrgba.G), + B: downscale8to5bit(nrgba.B), } - return ARGB1555{uint8(a), uint8(r >> 3), uint8(g >> 3), uint8(b >> 3)} } type RGBA5551 struct { @@ -588,27 +709,26 @@ type RGBA5551 struct { } func (c RGBA5551) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 3 - g = uint32(c.G) << 3 - b = uint32(c.B) << 3 - if c.A > 0 { - tmp := int32(-1) - a = uint32(tmp) + nrgba := color.NRGBA{ + R: upscale5to8bit(c.R), + G: upscale5to8bit(c.G), + B: upscale5to8bit(c.B), + A: upscale1to8bit(c.A), } - return + return nrgba.RGBA() } func rgba5551Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(RGBA5551); ok { return c } - r, g, b, a := c.RGBA() - if a > 0 { - a = 1 - } else { - a = 0 + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return RGBA5551{ + R: downscale8to5bit(nrgba.R), + G: downscale8to5bit(nrgba.G), + B: downscale8to5bit(nrgba.B), + A: downscale8to1bit(nrgba.A), } - return RGBA5551{uint8(r >> 3), uint8(g >> 3), uint8(b >> 3), uint8(a)} } type ABGR1555 struct { @@ -616,27 +736,26 @@ type ABGR1555 struct { } func (c ABGR1555) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 3 - g = uint32(c.G) << 3 - b = uint32(c.B) << 3 - if c.A > 0 { - tmp := int32(-1) - a = uint32(tmp) + nrgba := color.NRGBA{ + R: upscale5to8bit(c.R), + G: upscale5to8bit(c.G), + B: upscale5to8bit(c.B), + A: upscale1to8bit(c.A), } - return + return nrgba.RGBA() } func abgr1555Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(ABGR1555); ok { return c } - r, g, b, a := c.RGBA() - if a > 0 { - a = 1 - } else { - a = 0 + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return ABGR1555{ + A: downscale8to1bit(nrgba.A), + R: downscale8to5bit(nrgba.R), + G: downscale8to5bit(nrgba.G), + B: downscale8to5bit(nrgba.B), } - return ABGR1555{uint8(a), uint8(r >> 3), uint8(g >> 3), uint8(b >> 3)} } type BGRA5551 struct { @@ -644,27 +763,26 @@ type BGRA5551 struct { } func (c BGRA5551) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) << 3 - g = uint32(c.G) << 3 - b = uint32(c.B) << 3 - if c.A > 0 { - tmp := int32(-1) - a = uint32(tmp) + nrgba := color.NRGBA{ + R: upscale5to8bit(c.R), + G: upscale5to8bit(c.G), + B: upscale5to8bit(c.B), + A: upscale1to8bit(c.A), } - return + return nrgba.RGBA() } func bgra5551Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(BGRA5551); ok { return c } - r, g, b, a := c.RGBA() - if a > 0 { - a = 1 - } else { - a = 0 + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return BGRA5551{ + B: downscale8to5bit(nrgba.B), + G: downscale8to5bit(nrgba.G), + R: downscale8to5bit(nrgba.R), + A: downscale8to1bit(nrgba.A), } - return BGRA5551{uint8(b >> 3), uint8(g >> 3), uint8(r >> 3), uint8(a)} } type RGBA8888 struct { @@ -672,19 +790,26 @@ type RGBA8888 struct { } func (c RGBA8888) RGBA() (r, g, b, a uint32) { - r = uint32(c.R) - g = uint32(c.G) - b = uint32(c.B) - a = uint32(c.A) - return + nrgba := color.NRGBA{ + R: c.R, + G: c.G, + B: c.B, + A: c.A, + } + return nrgba.RGBA() } func rgba8888Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(RGBA8888); ok { return c } - r, g, b, a := c.RGBA() - return RGBA8888{uint8(r), uint8(g), uint8(b), uint8(a)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return RGBA8888{ + R: nrgba.R, + G: nrgba.G, + B: nrgba.B, + A: nrgba.A, + } } type BGRA8888 struct { @@ -692,17 +817,132 @@ type BGRA8888 struct { } func (c BGRA8888) RGBA() (r, g, b, a uint32) { - b = uint32(c.B) - g = uint32(c.G) - r = uint32(c.R) - a = uint32(c.A) - return + nrgba := color.NRGBA{ + R: c.R, + G: c.G, + B: c.B, + A: c.A, + } + return nrgba.RGBA() } func bgra8888Model(c color.Color) color.Color { - if _, ok := c.(color.RGBA); ok { + if _, ok := c.(BGRA8888); ok { + return c + } + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return BGRA8888{ + B: nrgba.B, + G: nrgba.G, + R: nrgba.R, + A: nrgba.A, + } +} + +type ARGB8888 struct { + A, R, G, B byte +} + +func (c ARGB8888) RGBA() (r, g, b, a uint32) { + nrgba := color.NRGBA{ + R: c.R, + G: c.G, + B: c.B, + A: c.A, + } + return nrgba.RGBA() +} + +func argb8888Model(c color.Color) color.Color { + if _, ok := c.(ARGB8888); ok { + return c + } + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return ARGB8888{ + A: nrgba.A, + R: nrgba.R, + G: nrgba.G, + B: nrgba.B, + } +} + +type ABGR8888 struct { + A, B, G, R byte +} + +func (c ABGR8888) RGBA() (r, g, b, a uint32) { + nrgba := color.NRGBA{ + R: c.R, + G: c.G, + B: c.B, + A: c.A, + } + return nrgba.RGBA() +} + +func abgr8888Model(c color.Color) color.Color { + if _, ok := c.(ABGR8888); ok { return c } - r, g, b, a := c.RGBA() - return BGRA8888{uint8(b), uint8(g), uint8(r), uint8(a)} + nrgba := color.NRGBAModel.Convert(c).(color.NRGBA) + return ABGR8888{ + A: nrgba.A, + B: nrgba.B, + G: nrgba.G, + R: nrgba.R, + } +} + +func downscale8to1bit(alpha byte) byte { + if alpha == 0 { + return 0 + } + return 1 +} + +func downscale8to2bit(in byte) byte { + return in >> 6 +} + +func downscale8to3bit(in byte) byte { + return in >> 5 +} + +func downscale8to4bit(in byte) byte { + return in >> 4 +} + +func downscale8to5bit(in byte) byte { + return in >> 3 +} + +func downscale8to6bit(in byte) byte { + return in >> 2 +} + +func upscale1to8bit(alphaBit byte) byte { + if alphaBit == 0 { + return 0 + } + return 0xFF +} + +func upscale2to8bit(in byte) byte { + return in<<6 | in<<4 | in<<2 | in +} + +func upscale3to8bit(in byte) byte { + return in<<5 | in<<2 | (in>>1)&0b11 +} + +func upscale4to8bit(in byte) byte { + return in<<4 | in +} + +func upscale5to8bit(in byte) byte { + return in<<3 | (in>>2)&0b111 +} + +func upscale6to8bit(in byte) byte { + return in<<2 | (in>>4)&0b11 } diff --git a/vendor/github.com/veandco/go-sdl2/sdl/rect.go b/vendor/github.com/veandco/go-sdl2/sdl/rect.go index 00208d2..aa6ffd7 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/rect.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/rect.go @@ -2,7 +2,10 @@ package sdl // #include "sdl_wrapper.h" import "C" -import "unsafe" +import ( + "math" + "unsafe" +) // Point defines a two dimensional point. // (https://wiki.libsdl.org/SDL_Point) @@ -217,6 +220,19 @@ func (a *FRect) Equals(b *FRect) bool { return false } +// EqualsEpsilon returns true if the two rectangles are equal, within some given epsilon. +// (https://wiki.libsdl.org/SDL_FRectEqualsEpsilon) +func (a *FRect) EqualsEpsilon(b *FRect, epsilon float32) bool { + if (a != nil) && (b != nil) && (a == b || + (float32(math.Abs(float64(a.X-b.X))) <= epsilon) && + (float32(math.Abs(float64(a.Y-b.Y))) <= epsilon) && + (float32(math.Abs(float64(a.W-b.W))) <= epsilon) && + (float32(math.Abs(float64(a.H-b.H))) <= epsilon)) { + return true + } + return false +} + // HasIntersection reports whether two rectangles intersect. // (https://wiki.libsdl.org/SDL_HasIntersection) func (a *FRect) HasIntersection(b *FRect) bool { @@ -410,6 +426,86 @@ func EnclosePoints(points []Point, clip *Rect) (Rect, bool) { return result, true } +// EncloseFPoints calculates a minimal rectangle that encloses a set of points with float precision. +// (https://wiki.libsdl.org/SDL_EncloseFPoints) +func EncloseFPoints(points []FPoint, clip *FRect) (result FRect, enclosed bool) { + if len(points) == 0 { + return result, false + } + + var minX, minY, maxX, maxY float32 + if clip != nil { + added := false + clipMinX := clip.X + clipMinY := clip.Y + clipMaxX := clip.X + clip.W - 1 + clipMaxY := clip.Y + clip.H - 1 + + // If the clip has no size, we're done + if clip.Empty() { + return result, false + } + + for _, val := range points { + // Check if the point is inside the clip rect + if val.X < clipMinX || val.X > clipMaxX || val.Y < clipMinY || val.Y > clipMaxY { + continue + } + + if !added { + // If it's the first point + minX = val.X + maxX = val.X + minY = val.Y + maxY = val.Y + added = true + } + + // Find mins and maxes + if val.X < minX { + minX = val.X + } else if val.X > maxX { + maxX = val.X + } + if val.Y < minY { + minY = val.Y + } else if val.Y > maxY { + maxY = val.Y + } + } + } else { + for i, val := range points { + if i == 0 { + // Populate the first point + minX = val.X + maxX = val.X + minY = val.Y + maxY = val.Y + continue + } + + // Find mins and maxes + if val.X < minX { + minX = val.X + } else if val.X > maxX { + maxX = val.X + } + if val.Y < minY { + minY = val.Y + } else if val.Y > maxY { + maxY = val.Y + } + } + } + + result.X = minX + result.Y = minY + result.W = (maxX - minX) + 1 + result.H = (maxY - minY) + 1 + + return result, true +} + const ( codeBottom = 1 codeTop = 2 @@ -433,6 +529,22 @@ func computeOutCode(rect *Rect, x, y int32) int { return code } +func computeFOutCode(rect *FRect, x, y float32) int { + code := 0 + if y < rect.Y { + code |= codeTop + } else if y >= rect.Y+rect.H { + code |= codeBottom + } + if x < rect.X { + code |= codeLeft + } else if x >= rect.X+rect.W { + code |= codeRight + } + + return code +} + // IntersectLine calculates the intersection of a rectangle and a line segment. // (https://wiki.libsdl.org/SDL_IntersectRectAndLine) func (a *Rect) IntersectLine(X1, Y1, X2, Y2 *int32) bool { @@ -549,3 +661,120 @@ func (a *Rect) IntersectLine(X1, Y1, X2, Y2 *int32) bool { return true } + +// IntersectLine calculates the intersection of a rectangle and a line segment. +// (https://wiki.libsdl.org/SDL_IntersectFRectAndLine) +func (a *FRect) IntersectLine(X1, Y1, X2, Y2 *float32) bool { + if a.Empty() { + return false + } + + x1 := *X1 + y1 := *Y1 + x2 := *X2 + y2 := *Y2 + rectX1 := a.X + rectY1 := a.Y + rectX2 := a.X + a.W - 1 + rectY2 := a.Y + a.H - 1 + + // Check if the line is entirely inside the rect + if x1 >= rectX1 && x1 <= rectX2 && x2 >= rectX1 && x2 <= rectX2 && + y1 >= rectY1 && y1 <= rectY2 && y2 >= rectY1 && y2 <= rectY2 { + return true + } + + // Check if the line is entirely outside the rect + if (x1 < rectX1 && x2 < rectX1) || (x1 > rectX2 && x2 > rectX2) || + (y1 < rectY1 && y2 < rectY1) || (y1 > rectY2 && y2 > rectY2) { + return false + } + + // Check if the line is horizontal + if y1 == y2 { + if x1 < rectX1 { + *X1 = rectX1 + } else if x1 > rectX2 { + *X1 = rectX2 + } + if x2 < rectX1 { + *X2 = rectX1 + } else if x2 > rectX2 { + *X2 = rectX2 + } + + return true + } + + // Check if the line is vertical + if x1 == x2 { + if y1 < rectY1 { + *Y1 = rectY1 + } else if y1 > rectY2 { + *Y1 = rectY2 + } + if y2 < rectY1 { + *Y2 = rectY1 + } else if y2 > rectY2 { + *Y2 = rectY2 + } + + return true + } + + // Use Cohen-Sutherland algorithm when all shortcuts fail + outCode1 := computeFOutCode(a, x1, y1) + outCode2 := computeFOutCode(a, x2, y2) + for outCode1 != 0 || outCode2 != 0 { + if outCode1&outCode2 != 0 { + return false + } + + if outCode1 != 0 { + var x, y float32 + if outCode1&codeTop != 0 { + y = rectY1 + x = x1 + ((x2-x1)*(y-y1))/(y2-y1) + } else if outCode1&codeBottom != 0 { + y = rectY2 + x = x1 + ((x2-x1)*(y-y1))/(y2-y1) + } else if outCode1&codeLeft != 0 { + x = rectX1 + y = y1 + ((y2-y1)*(x-x1))/(x2-x1) + } else if outCode1&codeRight != 0 { + x = rectX2 + y = y1 + ((y2-y1)*(x-x1))/(x2-x1) + } + + x1 = x + y1 = y + outCode1 = computeFOutCode(a, x, y) + } else { + var x, y float32 + if outCode2&codeTop != 0 { + y = rectY1 + x = x1 + ((x2-x1)*(y-y1))/(y2-y1) + } else if outCode2&codeBottom != 0 { + y = rectY2 + x = x1 + ((x2-x1)*(y-y1))/(y2-y1) + } else if outCode2&codeLeft != 0 { + x = rectX1 + y = y1 + ((y2-y1)*(x-x1))/(x2-x1) + } else if outCode2&codeRight != 0 { + x = rectX2 + y = y1 + ((y2-y1)*(x-x1))/(x2-x1) + } + + x2 = x + y2 = y + outCode2 = computeFOutCode(a, x, y) + } + } + + *X1 = x1 + *Y1 = y1 + *X2 = x2 + *Y2 = y2 + + return true +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/render.go b/vendor/github.com/veandco/go-sdl2/sdl/render.go index dbef9c4..7dfa07f 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/render.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/render.go @@ -15,6 +15,16 @@ static inline int SDL_UpdateYUVTexture(SDL_Texture* texture, const SDL_Rect* rec } #endif +#if !(SDL_VERSION_ATLEAST(2,0,4)) +#if defined(WARN_OUTDATED) +#pragma message("SDL_RenderIsClipEnabled is not supported before SDL 2.0.4") +#endif +static inline SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer) +{ + return SDL_FALSE; +} +#endif + #if !(SDL_VERSION_ATLEAST(2,0,5)) #if defined(WARN_OUTDATED) @@ -165,6 +175,132 @@ static inline int SDL_RenderFlush(SDL_Renderer * renderer) #endif +#if !(SDL_VERSION_ATLEAST(2,0,12)) + +typedef enum +{ + SDL_ScaleModeNearest, + SDL_ScaleModeLinear, + SDL_ScaleModeBest +} SDL_ScaleMode; + +#if defined(WARN_OUTDATED) +#pragma message("SDL_SetTextureScaleMode is not supported before SDL 2.0.12") +#pragma message("SDL_GetTextureScaleMode is not supported before SDL 2.0.12") +#pragma message("SDL_LockTextureToSurface is not supported before SDL 2.0.12") +#endif + +static int SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode) +{ + return -1; +} + +static int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode) +{ + return -1; +} + +static int SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface) +{ + return -1; +} +#endif + + +#if !(SDL_VERSION_ATLEAST(2,0,16)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_UpdateNVTexture is not supported before SDL 2.0.16") +#endif + +static int SDL_UpdateNVTexture(SDL_Texture * texture, const SDL_Rect * rect, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch) +{ + return -1; +} + +#endif + + +#if !(SDL_VERSION_ATLEAST(2,0,18)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_RenderGeometry is not supported before SDL 2.0.18") +#pragma message("SDL_RenderGeometryRaw is not supported before SDL 2.0.18") +#pragma message("SDL_SetTextureUserData is not supported before SDL 2.0.18") +#pragma message("SDL_GetTextureUserData is not supported before SDL 2.0.18") +#pragma message("SDL_RenderWindowToLogical is not supported before SDL 2.0.18") +#pragma message("SDL_RenderLogicalToWindow is not supported before SDL 2.0.18") +#pragma message("SDL_RenderSetVSync is not supported before SDL 2.0.18") +#endif + +// Vertex structure +typedef struct SDL_Vertex +{ + SDL_FPoint position; // Vertex position, in SDL_Renderer coordinates + SDL_Color color; // Vertex color + SDL_FPoint tex_coord; // Normalized texture coordinates, if needed +} SDL_Vertex; + +static int SDL_RenderGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices) +{ + return -1; +} + +static int SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices) +{ + return -1; +} + +static int SDL_SetTextureUserData(SDL_Texture * texture, void *userdata) +{ + return -1; +} + +static void * SDLCALL SDL_GetTextureUserData(SDL_Texture * texture) +{ + return NULL; +} + +static void SDL_RenderWindowToLogical(SDL_Renderer * renderer, int windowX, int windowY, float *logicalX, float *logicalY) +{ +} + +static void SDL_RenderLogicalToWindow(SDL_Renderer * renderer, float logicalX, float logicalY, int *windowX, int *windowY) +{ +} + +static int SDL_RenderSetVSync(SDL_Renderer* renderer, int vsync) +{ + return -1; +} + +#endif + +#if SDL_COMPILEDVERSION == SDL_VERSIONNUM(2,0,18) +static inline int RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices) +{ + return SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, (int*) color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices); +} +#else +static inline int RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices) +{ + return SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices); +} +#endif + +#if !(SDL_VERSION_ATLEAST(2,0,22)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_RenderGetWindow is not supported before SDL 2.0.22") +#endif + +static inline SDL_Window * SDLCALL SDL_RenderGetWindow(SDL_Renderer *renderer) +{ + return NULL; +} + +#endif + // WORKAROUND: This prevents audio from seemingly going corrupt when drawing outside the screen bounding box? // It does that by allocating SDL_Rect in the C context instead of Go context. static inline int RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Rect *src, int dst_x, int dst_y, int dst_w, int dst_h) @@ -188,6 +324,15 @@ const ( RENDERER_TARGETTEXTURE = C.SDL_RENDERER_TARGETTEXTURE // the renderer supports rendering to texture ) +type ScaleMode C.SDL_ScaleMode + +// The scaling mode for a texture. +const ( + ScaleModeNearest ScaleMode = C.SDL_ScaleModeNearest // nearest pixel sampling + ScaleModeLinear = C.SDL_ScaleModeLinear // linear filtering + ScaleModeBest = C.SDL_ScaleModeBest // anisotropic filtering +) + // An enumeration of texture access patterns.. // (https://wiki.libsdl.org/SDL_TextureAccess) const ( @@ -247,6 +392,13 @@ func (info *cRendererInfo) cptr() *C.SDL_RendererInfo { type RendererFlip uint32 type cRendererFlip C.SDL_RendererFlip +// Vertex structure +type Vertex struct { + Position FPoint // Vertex position, in SDL_Renderer coordinates + Color Color // Vertex color + TexCoord FPoint // Normalized texture coordinates, if needed +} + func (flip RendererFlip) c() C.SDL_RendererFlip { return C.SDL_RendererFlip(flip) } @@ -430,7 +582,7 @@ func (texture *Texture) GetBlendMode() (bm BlendMode, err error) { // Update updates the given texture rectangle with new pixel data. // (https://wiki.libsdl.org/SDL_UpdateTexture) -func (texture *Texture) Update(rect *Rect, pixels []byte, pitch int) error { +func (texture *Texture) Update(rect *Rect, pixels unsafe.Pointer, pitch int) error { if pixels == nil { return nil } @@ -438,7 +590,7 @@ func (texture *Texture) Update(rect *Rect, pixels []byte, pitch int) error { C.SDL_UpdateTexture( texture.cptr(), rect.cptr(), - unsafe.Pointer(&pixels[0]), + pixels, C.int(pitch)))) } @@ -571,6 +723,12 @@ func (renderer *Renderer) GetViewport() (rect Rect) { return } +// IsClipEnabled returns whether clipping is enabled on the given renderer. +// (https://wiki.libsdl.org/SDL_RenderIsClipEnabled) +func (renderer *Renderer) IsClipEnabled() bool { + return C.SDL_RenderIsClipEnabled(renderer.cptr()) == C.SDL_TRUE +} + // SetClipRect sets the clip rectangle for rendering on the specified target. // (https://wiki.libsdl.org/SDL_RenderSetClipRect) func (renderer *Renderer) SetClipRect(rect *Rect) error { @@ -986,3 +1144,123 @@ func (renderer *Renderer) GetMetalCommandEncoder() (encoder unsafe.Pointer, err } return } + +// UpdateNV updates a rectangle within a planar NV12 or NV21 texture with new pixels. +// (https://wiki.libsdl.org/SDL_UpdateNVTexture) +func (texture *Texture) UpdateNV(rect *Rect, yPlane []byte, yPitch int, uvPlane []byte, uvPitch int) error { + var yPlanePtr, uvPlanePtr *byte + if yPlane != nil { + yPlanePtr = &yPlane[0] + } + if uvPlane != nil { + uvPlanePtr = &uvPlane[0] + } + return errorFromInt(int( + C.SDL_UpdateNVTexture( + texture.cptr(), + rect.cptr(), + (*C.Uint8)(unsafe.Pointer(yPlanePtr)), + C.int(yPitch), + (*C.Uint8)(unsafe.Pointer(uvPlanePtr)), + C.int(uvPitch)))) +} + +// RenderGeometry renders a list of triangles, optionally using a texture and +// indices into the vertex array Color and alpha modulation is done per vertex +// (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored). +// (https://wiki.libsdl.org/SDL_RenderGeometry) +func (renderer *Renderer) RenderGeometry(texture *Texture, vertices []Vertex, indices []int32) (err error) { + _texture := texture.cptr() + _vertices := (*C.SDL_Vertex)(unsafe.Pointer(&vertices[0])) + _num_vertices := C.int(len(vertices)) + 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))) + return +} + +// RenderGeomtryRaw renders a list of triangles, optionally using a texture and +// indices into the vertex arrays Color and alpha modulation is done per vertex +// (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored). +// (https://wiki.libsdl.org/SDL_RenderGeometryRaw) +func (renderer *Renderer) RenderGeometryRaw(texture *Texture, xy *float32, xy_stride int, color *Color, color_stride int, uv *float32, uv_stride int, num_vertices int, indices unsafe.Pointer, num_indices int, size_indices int) (err error) { + _texture := texture.cptr() + _xy := (*C.float)(xy) + _xy_stride := C.int(xy_stride) + _color := (*C.SDL_Color)(unsafe.Pointer(color)) + _color_stride := C.int(color_stride) + _uv := (*C.float)(uv) + _uv_stride := C.int(uv_stride) + _num_vertices := C.int(num_vertices) + _num_indices := C.int(num_indices) + _size_indices := C.int(size_indices) + _indices := indices + + err = errorFromInt(int(C.RenderGeometryRaw(renderer.cptr(), _texture, _xy, _xy_stride, _color, _color_stride, _uv, _uv_stride, _num_vertices, _indices, _num_indices, _size_indices))) + return +} + +// SetTextureUserData associates a user-specified pointer with a texture. +// (https://wiki.libsdl.org/SDL_SetTextureUserData) +func (texture *Texture) SetTextureUserData(userdata unsafe.Pointer) (err error) { + err = errorFromInt(int(C.SDL_SetTextureUserData(texture.cptr(), userdata))) + return +} + +// GetTextureUserData gets the user-specified pointer associated with a texture. +// (https://wiki.libsdl.org/SDL_GetTextureUserData) +func (texture *Texture) GetTextureUserData() (userdata unsafe.Pointer) { + userdata = C.SDL_GetTextureUserData(texture.cptr()) + return +} + +// RenderWindowToLogical gets logical coordinates of point in renderer when given real coordinates of +// point in window. +// +// Logical coordinates will differ from real coordinates when render is scaled +// and logical renderer size set +// +// (https://wiki.libsdl.org/SDL_RenderWindowToLogical) +func (renderer *Renderer) RenderWindowToLogical(windowX, windowY int) (logicalX, logicalY float32) { + _windowX := C.int(windowX) + _windowY := C.int(windowY) + _logicalX := C.float(0) + _logicalY := C.float(0) + C.SDL_RenderWindowToLogical(renderer.cptr(), _windowX, _windowY, &_logicalX, &_logicalY) + logicalX = float32(_logicalX) + logicalY = float32(_logicalY) + return +} + +// RenderLogicalToWindow gets real coordinates of point in window when given logical coordinates of point in renderer. +// Logical coordinates will differ from real coordinates when render is scaled and logical renderer size set. +// (https://wiki.libsdl.org/SDL_RenderLogicalToWindow) +func (renderer *Renderer) RenderLogicalToWindow(logicalX, logicalY float32) (windowX, windowY int) { + _logicalX := C.float(logicalX) + _logicalY := C.float(logicalY) + _windowX := C.int(0) + _windowY := C.int(0) + C.SDL_RenderLogicalToWindow(renderer.cptr(), _logicalX, _logicalY, &_windowX, &_windowY) + windowX = int(_windowX) + windowY = int(_windowY) + return +} + +// RenderSetVSync toggles VSync of the given renderer. +// (https://wiki.libsdl.org/SDL_RenderSetVSync) +func (renderer *Renderer) RenderSetVSync(vsync bool) (err error) { + _vsync := C.int(Btoi(vsync)) + err = errorFromInt(int(C.SDL_RenderSetVSync(renderer.cptr(), _vsync))) + return +} + +// GetWindow gets the window associated with a renderer. +// (https://wiki.libsdl.org/SDL_RenderGetWindow) +func (renderer *Renderer) GetWindow() (window *Window, err error) { + window = (*Window)(unsafe.Pointer(C.SDL_RenderGetWindow(renderer.cptr()))) + return +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/sdl_cgo_static.go b/vendor/github.com/veandco/go-sdl2/sdl/sdl_cgo_static.go index 41f4257..9e48380 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/sdl_cgo_static.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/sdl_cgo_static.go @@ -2,13 +2,18 @@ package sdl -//#cgo CFLAGS: -I${SRCDIR}/../.go-sdl2-libs/include -I${SRCDIR}/../.go-sdl2-libs/include/SDL2 -//#cgo LDFLAGS: -L${SRCDIR}/../.go-sdl2-libs +//#cgo CFLAGS: -I${SRCDIR}/../_libs/include -I${SRCDIR}/../_libs/include/SDL2 +//#cgo LDFLAGS: -L${SRCDIR}/../_libs //#cgo linux,386 LDFLAGS: -lSDL2_linux_386 -lm -ldl -lasound -lm -ldl -lpthread -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lpthread -lrt //#cgo linux,amd64 LDFLAGS: -lSDL2_linux_amd64 -lm -ldl -lasound -lm -ldl -lpthread -lX11 -lXext -lXcursor -lXinerama -lXi -lXrandr -lXss -lXxf86vm -lpthread -lrt //#cgo windows,386 LDFLAGS: -lSDL2_windows_386 -lSDL2main_windows_386 -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid -static-libgcc //#cgo windows,amd64 LDFLAGS: -lSDL2_windows_amd64 -lSDL2main_windows_amd64 -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -lsetupapi -static-libgcc //#cgo darwin,amd64 LDFLAGS: -lSDL2_darwin_amd64 -lm -liconv -Wl,-framework,OpenGL -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,Metal +//#cgo darwin,arm64 LDFLAGS: -lSDL2_darwin_arm64 -lm -liconv -Wl,-framework,OpenGL -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,Metal //#cgo android,arm LDFLAGS: -lSDL2_android_arm -lm -ldl -llog -landroid -lGLESv2 -lGLESv1_CM //#cgo linux,arm,!android LDFLAGS: -L/opt/vc/lib -L/opt/vc/lib64 -lSDL2_linux_arm -lm -ldl -liconv -lbcm_host -lvcos -lvchiq_arm -pthread import "C" +import ( + _ "github.com/veandco/go-sdl2/_libs" + _ "github.com/veandco/go-sdl2/_libs" +) diff --git a/vendor/github.com/veandco/go-sdl2/sdl/sensor.go b/vendor/github.com/veandco/go-sdl2/sdl/sensor.go index 6527e2e..1ec3b29 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/sensor.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/sensor.go @@ -169,10 +169,10 @@ const ( // Here are the additional Android sensors: // https://developer.android.com/reference/android/hardware/SensorEvent.html#values const ( - SENSOR_INVALID SensorType = -1 // Returned for an invalid sensor - SENSOR_UNKNOWN // Unknown sensor type - SENSOR_ACCEL // Accelerometer - SENSOR_GYRO // Gyroscope + SENSOR_INVALID SensorType = C.SDL_SENSOR_INVALID // Returned for an invalid sensor + SENSOR_UNKNOWN SensorType = C.SDL_SENSOR_UNKNOWN // Unknown sensor type + SENSOR_ACCEL SensorType = C.SDL_SENSOR_ACCEL // Accelerometer + SENSOR_GYRO SensorType = C.SDL_SENSOR_GYRO // Gyroscope ) type Sensor C.SDL_Sensor diff --git a/vendor/github.com/veandco/go-sdl2/sdl/shape.go b/vendor/github.com/veandco/go-sdl2/sdl/shape.go new file mode 100644 index 0000000..eff1de0 --- /dev/null +++ b/vendor/github.com/veandco/go-sdl2/sdl/shape.go @@ -0,0 +1,182 @@ +package sdl + +/* +#include "sdl_wrapper.h" + +// until SDL 2.0.6 SDL_shape.h was not included in SDL.h +#if !(SDL_VERSION_ATLEAST(2,0,6)) +#if defined(_WIN32) + #include +#else + #include +#endif +#endif +*/ +import "C" +import "unsafe" + +const ( + NONSHAPEABLE_WINDOW = C.SDL_NONSHAPEABLE_WINDOW + INVALID_SHAPE_ARGUMENT = C.SDL_INVALID_SHAPE_ARGUMENT + WINDOW_LACKS_SHAPE = C.SDL_WINDOW_LACKS_SHAPE +) + +type WindowShapeModeKind C.WindowShapeMode + +const ( + ShapeModeDefaultKind WindowShapeModeKind = C.ShapeModeDefault // the default mode, a binarized alpha cutoff of 1 + ShapeModeBinarizeAlphaKind WindowShapeModeKind = C.ShapeModeBinarizeAlpha // a binarized alpha cutoff with a given integer value + ShapeModeReverseBinarizeAlphaKind WindowShapeModeKind = C.ShapeModeReverseBinarizeAlpha // a binarized alpha cutoff with a given integer value, but with the opposite comparison + ShapeModeColorKeyKind WindowShapeModeKind = C.ShapeModeColorKey // a color key is applied +) + +func SHAPEMODEALPHA(mode WindowShapeModeKind) bool { + return (mode == ShapeModeDefaultKind || + mode == ShapeModeBinarizeAlphaKind || + mode == ShapeModeReverseBinarizeAlphaKind) +} + +// A union containing parameters for shaped windows +// uint8 or Color +type cWindowShapeParams C.SDL_WindowShapeParams + +type cWindowShapeMode struct { + mode WindowShapeModeKind + parameters cWindowShapeParams +} + +type WindowShapeMode interface { + Mode() WindowShapeModeKind + cWSM() cWindowShapeMode +} + +type ShapeModeDefault struct{} + +func (smd ShapeModeDefault) Mode() WindowShapeModeKind { + return ShapeModeDefaultKind +} + +func (smd ShapeModeDefault) cWSM() cWindowShapeMode { + return cWindowShapeMode{ + mode: ShapeModeDefaultKind, + parameters: [4]uint8{1, 0, 0, 0}, + } +} + +type ShapeModeBinarizeAlpha struct { + Cutoff uint8 +} + +func (smba ShapeModeBinarizeAlpha) Mode() WindowShapeModeKind { + return ShapeModeBinarizeAlphaKind +} + +func (smba ShapeModeBinarizeAlpha) cWSM() cWindowShapeMode { + return cWindowShapeMode{ + mode: ShapeModeBinarizeAlphaKind, + parameters: [4]uint8{smba.Cutoff, 0, 0, 0}, + } +} + +type ShapeModeReverseBinarizeAlpha struct { + Cutoff uint8 +} + +func (smba ShapeModeReverseBinarizeAlpha) Mode() WindowShapeModeKind { + return ShapeModeReverseBinarizeAlphaKind +} + +func (smba ShapeModeReverseBinarizeAlpha) cWSM() cWindowShapeMode { + return cWindowShapeMode{ + mode: ShapeModeReverseBinarizeAlphaKind, + parameters: [4]uint8{smba.Cutoff, 0, 0, 0}, + } +} + +type ShapeModeColorKey struct { + Color Color +} + +func (smck ShapeModeColorKey) Mode() WindowShapeModeKind { + return ShapeModeColorKeyKind +} + +func (smck ShapeModeColorKey) cWSM() cWindowShapeMode { + return cWindowShapeMode{ + mode: ShapeModeReverseBinarizeAlphaKind, + parameters: [4]uint8{smck.Color.R, smck.Color.G, smck.Color.B, smck.Color.A}, + } +} + +func (cwsm cWindowShapeMode) goWSM() WindowShapeMode { + switch cwsm.mode { + case ShapeModeDefaultKind: + return ShapeModeDefault{} + + case ShapeModeBinarizeAlphaKind: + return ShapeModeBinarizeAlpha{ + Cutoff: ([4]uint8)(cwsm.parameters)[0], + } + + case ShapeModeReverseBinarizeAlphaKind: + return ShapeModeReverseBinarizeAlpha{ + Cutoff: ([4]uint8)(cwsm.parameters)[0], + } + + case ShapeModeColorKeyKind: + return ShapeModeColorKey{ + Color: Color{ + R: ([4]uint8)(cwsm.parameters)[0], + G: ([4]uint8)(cwsm.parameters)[1], + B: ([4]uint8)(cwsm.parameters)[2], + A: ([4]uint8)(cwsm.parameters)[3], + }, + } + + default: + panic("Unknown WindowShapeModeKind") + + } +} + +func (wsm *cWindowShapeMode) cptr() *C.SDL_WindowShapeMode { + return (*C.SDL_WindowShapeMode)(unsafe.Pointer(wsm)) +} + +// CreateShapedWindow creates a window that can be shaped with the specified position, dimensions, and flags +// (https://wiki.libsdl.org/SDL_CreateShapedWindow) +func CreateShapedWindow(title string, x, y, w, h uint32, flags uint32) (*Window, error) { + var _window = C.SDL_CreateShapedWindow(C.CString(title), C.uint(x), C.uint(y), C.uint(w), C.uint(h), C.Uint32(flags)) + if _window == nil { + return nil, GetError() + } + return (*Window)(unsafe.Pointer(_window)), nil +} + +// IsShapedWindow returns whether the given window is a shaped window. +// (https://wiki.libsdl.org/SDL_IsShapedWindow) +func (window *Window) IsShaped() bool { + return (C.SDL_IsShapedWindow(window.cptr()) & 1) == 1 +} + +// SetShape sets the shape and parameters of a shaped window +// (https://wiki.libsdl.org/SDL_SetWindowShape) +func (window *Window) SetShape(shape *Surface, shape_mode WindowShapeMode) int32 { + if shape_mode == nil { + panic("shape_mode can not be nil") + } + var _cWSM cWindowShapeMode = shape_mode.cWSM() + + return (int32)(C.SDL_SetWindowShape(window.cptr(), shape.cptr(), _cWSM.cptr())) +} + +// GetShapeMode gets the shape parameters of a shaped window +// (https://wiki.libsdl.org/SDL_GetShapedWindowMode) +func (window *Window) GetShapeMode() (WindowShapeMode, int32) { + var _cWSM cWindowShapeMode + var _resInt32 = (int32)(C.SDL_GetShapedWindowMode(window.cptr(), _cWSM.cptr())) + if _resInt32 != 0 { + return nil, _resInt32 + } + return _cWSM.goWSM(), _resInt32 +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/surface.go b/vendor/github.com/veandco/go-sdl2/sdl/surface.go index e534c60..774c372 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/surface.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/surface.go @@ -87,6 +87,33 @@ static inline SDL_Surface* SDL_CreateRGBSurfaceWithFormatFrom(void* pixels, int return NULL; } #endif + + +#if !(SDL_VERSION_ATLEAST(2,0,16)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_SoftStretchLinear is not supported before SDL 2.0.16") +#endif + +static int SDL_SoftStretchLinear(SDL_Surface * src, const SDL_Rect * srcrect, SDL_Surface * dst, const SDL_Rect * dstrect) +{ + return -1; +} + +#endif + +#if !(SDL_VERSION_ATLEAST(2,0,18)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_PremultiplyAlpha is not supported before SDL 2.0.18") +#endif + +static int SDL_PremultiplyAlpha(int width, int height, Uint32 src_format, const void * src, int src_pitch, Uint32 dst_format, void * dst, int dst_pitch) +{ + return -1; +} + +#endif */ import "C" import ( @@ -599,180 +626,181 @@ func (surface *Surface) Bounds() image.Rectangle { func (surface *Surface) At(x, y int) color.Color { pix := surface.Pixels() i := int32(y)*surface.Pitch + int32(x)*int32(surface.Format.BytesPerPixel) - switch surface.Format.Format { - /* - case PIXELFORMAT_ARGB8888: - return color.RGBA{pix[i+3], pix[i], pix[i+1], pix[i+2]} - case PIXELFORMAT_ABGR8888: - return color.RGBA{pix[i], pix[i+3], pix[i+2], pix[i+1]} - */ - case PIXELFORMAT_RGB888: - return color.RGBA{pix[i], pix[i+1], pix[i+2], 0xff} - default: - panic("Not implemented yet") - } + r, g, b, a := GetRGBA(*((*uint32)(unsafe.Pointer(&pix[i]))), surface.Format) + return color.NRGBA{R: r, G: g, B: b, A: a} } -// Set the color of the pixel at (x, y) using this surface's color model to -// convert c to the appropriate color. This method is required for the +// Set the color of the pixel at (x, y) using this surface's color format to +// convert c to the appropriate byte sequence. This method is required for the // draw.Image interface. The surface may require locking before calling Set. func (surface *Surface) Set(x, y int, c color.Color) { + // All sdl2 colors are a subset of NRGBA so it is safe precision-wise to + // convert to NRGBA and use the color components from there. + nrgbaColor := color.NRGBAModel.Convert(c).(color.NRGBA) + colR, colG, colB, colA := nrgbaColor.R, nrgbaColor.G, nrgbaColor.B, nrgbaColor.A + pix := surface.Pixels() i := int32(y)*surface.Pitch + int32(x)*int32(surface.Format.BytesPerPixel) switch surface.Format.Format { case PIXELFORMAT_ARGB8888: - col := surface.ColorModel().Convert(c).(color.RGBA) - pix[i+0] = col.B - pix[i+1] = col.G - pix[i+2] = col.R - pix[i+3] = col.A + pix[i+3] = colA + pix[i+2] = colR + pix[i+1] = colG + pix[i+0] = colB case PIXELFORMAT_ABGR8888: - col := surface.ColorModel().Convert(c).(color.RGBA) - pix[i+3] = col.R - pix[i+2] = col.G - pix[i+1] = col.B - pix[i+0] = col.A + pix[i+3] = colA + pix[i+2] = colB + pix[i+1] = colG + pix[i+0] = colR case PIXELFORMAT_RGB24, PIXELFORMAT_RGB888: - col := surface.ColorModel().Convert(c).(color.RGBA) - pix[i+0] = col.B - pix[i+1] = col.G - pix[i+2] = col.R + pix[i+2] = colR + pix[i+1] = colG + pix[i+0] = colB case PIXELFORMAT_BGR24, PIXELFORMAT_BGR888: - col := surface.ColorModel().Convert(c).(color.RGBA) - pix[i+2] = col.R - pix[i+1] = col.G - pix[i+0] = col.B + pix[i+2] = colB + pix[i+1] = colG + pix[i+0] = colR case PIXELFORMAT_RGB444: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 4 & 0x0F - g := uint32(col.G) >> 4 & 0x0F - b := uint32(col.B) >> 4 & 0x0F + r := uint32(colR) >> 4 & 0x0F + g := uint32(colG) >> 4 & 0x0F + b := uint32(colB) >> 4 & 0x0F *buf = r<<8 | g<<4 | b case PIXELFORMAT_RGB332: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 5 & 0x0F - g := uint32(col.G) >> 5 & 0x0F - b := uint32(col.B) >> 6 & 0x0F + r := uint32(colR) >> 5 & 0x0F + g := uint32(colG) >> 5 & 0x0F + b := uint32(colB) >> 6 & 0x0F *buf = r<<5 | g<<2 | b case PIXELFORMAT_RGB565: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 3 & 0xFF - g := uint32(col.G) >> 2 & 0xFF - b := uint32(col.B) >> 3 & 0xFF + r := uint32(colR) >> 3 & 0xFF + g := uint32(colG) >> 2 & 0xFF + b := uint32(colB) >> 3 & 0xFF *buf = r<<11 | g<<5 | b case PIXELFORMAT_RGB555: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 3 & 0xFF - g := uint32(col.G) >> 3 & 0xFF - b := uint32(col.B) >> 3 & 0xFF + r := uint32(colR) >> 3 & 0xFF + g := uint32(colG) >> 3 & 0xFF + b := uint32(colB) >> 3 & 0xFF *buf = r<<10 | g<<5 | b case PIXELFORMAT_BGR565: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 3 & 0xFF - g := uint32(col.G) >> 2 & 0xFF - b := uint32(col.B) >> 3 & 0xFF + r := uint32(colR) >> 3 & 0xFF + g := uint32(colG) >> 2 & 0xFF + b := uint32(colB) >> 3 & 0xFF *buf = b<<11 | g<<5 | r case PIXELFORMAT_BGR555: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 3 & 0xFF - g := uint32(col.G) >> 3 & 0xFF - b := uint32(col.B) >> 3 & 0xFF + r := uint32(colR) >> 3 & 0xFF + g := uint32(colG) >> 3 & 0xFF + b := uint32(colB) >> 3 & 0xFF *buf = b<<10 | g<<5 | r case PIXELFORMAT_ARGB4444: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - a := uint32(col.A) >> 4 & 0x0F - r := uint32(col.R) >> 4 & 0x0F - g := uint32(col.G) >> 4 & 0x0F - b := uint32(col.B) >> 4 & 0x0F + a := uint32(colA) >> 4 & 0x0F + r := uint32(colR) >> 4 & 0x0F + g := uint32(colG) >> 4 & 0x0F + b := uint32(colB) >> 4 & 0x0F *buf = a<<12 | r<<8 | g<<4 | b case PIXELFORMAT_ABGR4444: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - a := uint32(col.A) >> 4 & 0x0F - r := uint32(col.R) >> 4 & 0x0F - g := uint32(col.G) >> 4 & 0x0F - b := uint32(col.B) >> 4 & 0x0F + a := uint32(colA) >> 4 & 0x0F + r := uint32(colR) >> 4 & 0x0F + g := uint32(colG) >> 4 & 0x0F + b := uint32(colB) >> 4 & 0x0F *buf = a<<12 | b<<8 | g<<4 | r case PIXELFORMAT_RGBA4444: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 4 & 0x0F - g := uint32(col.G) >> 4 & 0x0F - b := uint32(col.B) >> 4 & 0x0F - a := uint32(col.A) >> 4 & 0x0F + r := uint32(colR) >> 4 & 0x0F + g := uint32(colG) >> 4 & 0x0F + b := uint32(colB) >> 4 & 0x0F + a := uint32(colA) >> 4 & 0x0F *buf = r<<12 | g<<8 | b<<4 | a case PIXELFORMAT_BGRA4444: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 4 & 0x0F - g := uint32(col.G) >> 4 & 0x0F - b := uint32(col.B) >> 4 & 0x0F - a := uint32(col.A) >> 4 & 0x0F + r := uint32(colR) >> 4 & 0x0F + g := uint32(colG) >> 4 & 0x0F + b := uint32(colB) >> 4 & 0x0F + a := uint32(colA) >> 4 & 0x0F *buf = b<<12 | g<<8 | r<<4 | a case PIXELFORMAT_ARGB1555: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 3 & 0xFF - g := uint32(col.G) >> 3 & 0xFF - b := uint32(col.B) >> 3 & 0xFF + r := uint32(colR) >> 3 & 0xFF + g := uint32(colG) >> 3 & 0xFF + b := uint32(colB) >> 3 & 0xFF a := uint32(0) - if col.A > 0 { + if colA > 0 { a = 1 } *buf = a<<15 | r<<10 | g<<5 | b case PIXELFORMAT_RGBA5551: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 3 & 0xFF - g := uint32(col.G) >> 3 & 0xFF - b := uint32(col.B) >> 3 & 0xFF + r := uint32(colR) >> 3 & 0xFF + g := uint32(colG) >> 3 & 0xFF + b := uint32(colB) >> 3 & 0xFF a := uint32(0) - if col.A > 0 { + if colA > 0 { a = 1 } *buf = r<<11 | g<<6 | b<<1 | a case PIXELFORMAT_ABGR1555: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 3 & 0xFF - g := uint32(col.G) >> 3 & 0xFF - b := uint32(col.B) >> 3 & 0xFF + r := uint32(colR) >> 3 & 0xFF + g := uint32(colG) >> 3 & 0xFF + b := uint32(colB) >> 3 & 0xFF a := uint32(0) - if col.A > 0 { + if colA > 0 { a = 1 } *buf = a<<15 | b<<10 | g<<5 | r case PIXELFORMAT_BGRA5551: - col := surface.ColorModel().Convert(c).(color.RGBA) buf := (*uint32)(unsafe.Pointer(&pix[i])) - r := uint32(col.R) >> 3 & 0xFF - g := uint32(col.G) >> 3 & 0xFF - b := uint32(col.B) >> 3 & 0xFF + r := uint32(colR) >> 3 & 0xFF + g := uint32(colG) >> 3 & 0xFF + b := uint32(colB) >> 3 & 0xFF a := uint32(0) - if col.A > 0 { + if colA > 0 { a = 1 } *buf = b<<11 | g<<6 | r<<1 | a case PIXELFORMAT_RGBA8888: - col := surface.ColorModel().Convert(c).(color.RGBA) - pix[i+3] = col.R - pix[i+2] = col.G - pix[i+1] = col.B - pix[i+0] = col.A + pix[i+3] = colR + pix[i+2] = colG + pix[i+1] = colB + pix[i+0] = colA case PIXELFORMAT_BGRA8888: - col := surface.ColorModel().Convert(c).(color.RGBA) - pix[i+3] = col.B - pix[i+2] = col.G - pix[i+1] = col.R - pix[i+0] = col.A + pix[i+3] = colB + pix[i+2] = colG + pix[i+1] = colR + pix[i+0] = colA default: panic("Unknown pixel format!") } } + +// SoftStretchLinear performs bilinear scaling between two surfaces of the same format, 32BPP. +// (https://wiki.libsdl.org/SDL_SoftStretchLinear) +func (surface *Surface) SoftStretchLinear(srcRect *Rect, dst *Surface, dstRect *Rect) (err error) { + return errorFromInt(int(C.SDL_SoftStretchLinear(surface.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()))) +} + +// PremultiplyAlpha premultiplies the alpha on a block of pixels. +// +// This is safe to use with src == dst, but not for other overlapping areas. +// +// This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888. +// +// (https://wiki.libsdl.org/SDL_PremultiplyAlpha) +func PremultiplyAlpha(width, height int, srcFormat uint32, src []byte, srcPitch int, dstFormat uint32, dst []byte, dstPitch int) (err error) { + _width := C.int(width) + _height := C.int(height) + _srcFormat := C.Uint32(srcFormat) + _src := unsafe.Pointer(&src[0]) + _srcPitch := C.int(srcPitch) + _dstFormat := C.Uint32(dstFormat) + _dst := unsafe.Pointer(&dst[0]) + _dstPitch := C.int(dstPitch) + err = errorFromInt(int(C.SDL_PremultiplyAlpha(_width, _height, _srcFormat, _src, _srcPitch, _dstFormat, _dst, _dstPitch))) + return +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/system.c b/vendor/github.com/veandco/go-sdl2/sdl/system.c new file mode 100644 index 0000000..03c96ae --- /dev/null +++ b/vendor/github.com/veandco/go-sdl2/sdl/system.c @@ -0,0 +1,9 @@ +#include "_cgo_export.h" +#include "system.h" + +#if defined(_WIN32) +void SetWindowsMessageHook() +{ + SDL_SetWindowsMessageHook((SDL_WindowsMessageHook) goWindowsMessageHook, NULL); +} +#endif diff --git a/vendor/github.com/veandco/go-sdl2/sdl/system.go b/vendor/github.com/veandco/go-sdl2/sdl/system.go index 57cb279..134d6f1 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/system.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/system.go @@ -15,11 +15,9 @@ static inline SDL_bool SDL_IsTablet() } #endif - */ import "C" - // IsTablet returns true if the current device is a tablet // TODO: (https://wiki.libsdl.org/SDL_IsTablet) func IsTablet() bool { diff --git a/vendor/github.com/veandco/go-sdl2/sdl/system.h b/vendor/github.com/veandco/go-sdl2/sdl/system.h new file mode 100644 index 0000000..fa8cbf9 --- /dev/null +++ b/vendor/github.com/veandco/go-sdl2/sdl/system.h @@ -0,0 +1,8 @@ +#ifndef _GO_SDL_SYSTEM_H +#define _GO_SDL_SYSTEM_H + +#if defined(_WIN32) + extern void SetWindowsMessageHook(); +#endif + +#endif diff --git a/vendor/github.com/veandco/go-sdl2/sdl/system_android.go b/vendor/github.com/veandco/go-sdl2/sdl/system_android.go index 4287268..efae279 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/system_android.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/system_android.go @@ -15,7 +15,23 @@ static int SDL_IsAndroidTV(void) { return -1; } + +#endif + + +#if !(SDL_VERSION_ATLEAST(2,0,16)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_AndroidShowToast is not supported before SDL 2.0.16") #endif + +static int SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset) +{ + return -1; +} + +#endif + */ import "C" import "unsafe" @@ -62,3 +78,11 @@ func AndroidGetActivity() unsafe.Pointer { func IsAndroidTV() bool { return C.SDL_IsAndroidTV() >= 0 } + +// AndroidShowToast shows an Android toast notification. +// (https://wiki.libsdl.org/SDL_AndroidShowToast) +func AndroidShowToast(message string, duration, gravity, xoffset, yoffset int) (err error) { + _message := C.CString(message) + defer C.free(unsafe.Pointer(_message)) + return errorFromInt(int(C.SDL_AndroidShowToast(_message, C.int(duration), C.int(gravity), C.int(xoffset), C.int(yoffset)))) +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/system_linux.go b/vendor/github.com/veandco/go-sdl2/sdl/system_linux.go new file mode 100644 index 0000000..e5a3435 --- /dev/null +++ b/vendor/github.com/veandco/go-sdl2/sdl/system_linux.go @@ -0,0 +1,57 @@ +// +build !android + +package sdl + +/* +#include "sdl_wrapper.h" + +#if !(SDL_VERSION_ATLEAST(2,0,9)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_LinuxSetThreadPriority is not supported before SDL 2.0.9") +#endif + +static int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority) +{ + return -1; +} + +#endif + +#if !(SDL_VERSION_ATLEAST(2,0,18)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_LinuxSetThreadPriorityAndPolicy is not supported before SDL 2.0.18") +#endif + +static int SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) +{ + return -1; +} + +#endif +*/ +import "C" + +// LinuxSetThreadPriority sets the UNIX nice value for a thread. +// +// This uses setpriority() if possible, and RealtimeKit if available. +// +// (https://wiki.libsdl.org/SDL_LinuxSetThreadPriority) +func LinuxSetThreadPriority(threadID int64, priority int) (err error) { + _threadID := C.Sint64(threadID) + _priority := C.int(priority) + return errorFromInt(int(C.SDL_LinuxSetThreadPriority(_threadID, _priority))) +} + +// LinuxSetThreadPriority sets the priority (not nice level) and scheduling policy for a thread. +// +// This uses setpriority() if possible, and RealtimeKit if available. +// +// (https://wiki.libsdl.org/SDL_LinuxSetThreadPriorityAndPolicy) +func LinuxSetThreadPriorityAndPolicy(threadID int64, sdlPriority, schedPolicy int) (err error) { + _threadID := C.Sint64(threadID) + _sdlPriority := C.int(sdlPriority) + _schedPolicy := C.int(schedPolicy) + return errorFromInt(int(C.SDL_LinuxSetThreadPriorityAndPolicy(_threadID, _sdlPriority, _schedPolicy))) +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/system_windows.go b/vendor/github.com/veandco/go-sdl2/sdl/system_windows.go new file mode 100644 index 0000000..5475226 --- /dev/null +++ b/vendor/github.com/veandco/go-sdl2/sdl/system_windows.go @@ -0,0 +1,55 @@ +package sdl + +/* +#include "sdl_wrapper.h" +#include "system.h" + +#if !(SDL_VERSION_ATLEAST(2,0,16)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_RenderGetD3D11Device is not supported before SDL 2.0.16") +#endif + +typedef struct ID3D11Device ID3D11Device; + +static ID3D11Device* SDL_RenderGetD3D11Device(SDL_Renderer * renderer) +{ + return NULL; +} + +#endif +*/ +import "C" +import ( + "unsafe" +) + +type WindowsMessageHook func(userdata interface{}, hWnd unsafe.Pointer, message uint32, wParam uint64, lParam int64) +var windowsMessageHook WindowsMessageHook + +type ID3D11Device C.ID3D11Device; + +// SetWindowsMessageHook sets a callback for every Windows message, run before TranslateMessage(). +// (https://wiki.libsdl.org/SDL_SetWindowsMessageHook) +func SetWindowsMessageHook(callback WindowsMessageHook, userdata interface{}) { + windowsMessageHook = callback + C.SetWindowsMessageHook() +} + +//export goWindowsMessageHook +func goWindowsMessageHook(userdata interface{}, hWnd unsafe.Pointer, message uint32, wParam uint64, lParam int64) { + if windowsMessageHook == nil { + return + } + windowsMessageHook(userdata, hWnd, message, wParam, lParam) +} + +// SDL_RenderGetD3D11Device gets the D3D11 device associated with a renderer. +// (https://wiki.libsdl.org/SDL_RenderGetD3D11Device) +func (renderer *Renderer) GetD3D11Device() (device *ID3D11Device, err error) { + device = (*ID3D11Device)(C.SDL_RenderGetD3D11Device(renderer.cptr())) + if device == nil { + err = GetError() + } + return +} diff --git a/vendor/github.com/veandco/go-sdl2/sdl/syswm.go b/vendor/github.com/veandco/go-sdl2/sdl/syswm.go index dda16a8..0a63148 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/syswm.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/syswm.go @@ -70,6 +70,8 @@ type SysWMInfo struct { // WindowsInfo contains Microsoft Windows window information. type WindowsInfo struct { Window unsafe.Pointer // the window handle + DeviceContext unsafe.Pointer // the device context handle + Instance unsafe.Pointer // the instance handle } // X11Info contains X Window System window information. diff --git a/vendor/github.com/veandco/go-sdl2/sdl/timer.go b/vendor/github.com/veandco/go-sdl2/sdl/timer.go index 0839e41..565adb4 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/timer.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/timer.go @@ -1,14 +1,41 @@ package sdl -// #include "sdl_wrapper.h" +/* +#include "sdl_wrapper.h" + +#if !(SDL_VERSION_ATLEAST(2,0,18)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_GetTicks64 is not supported before SDL 2.0.18") +#endif + +static inline Uint64 SDLCALL SDL_GetTicks64(void) +{ + return 0; +} +#endif +*/ import "C" // GetTicks returns the number of milliseconds since the SDL library initialization. +// +// Deprecated: This function is not recommended as of SDL 2.0.18; use GetTicks64() +// instead, where the value doesn't wrap every ~49 days. There are places in +// SDL where we provide a 32-bit timestamp that can not change without +// breaking binary compatibility, though, so this function isn't officially +// deprecated. +// // (https://wiki.libsdl.org/SDL_GetTicks) func GetTicks() uint32 { return uint32(C.SDL_GetTicks()) } +// GetTicks64 returns the number of milliseconds since the SDL library initialization. +// (https://wiki.libsdl.org/SDL_GetTicks64) +func GetTicks64() uint64 { + return uint64(C.SDL_GetTicks64()) +} + // GetPerformanceCounter returns the current value of the high resolution counter. // (https://wiki.libsdl.org/SDL_GetPerformanceCounter) func GetPerformanceCounter() uint64 { diff --git a/vendor/github.com/veandco/go-sdl2/sdl/video.go b/vendor/github.com/veandco/go-sdl2/sdl/video.go index 6148ab1..1343934 100644 --- a/vendor/github.com/veandco/go-sdl2/sdl/video.go +++ b/vendor/github.com/veandco/go-sdl2/sdl/video.go @@ -170,6 +170,67 @@ static int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect* rect) #define SDL_GL_CONTEXT_NO_ERROR (0) #endif + + +#if !(SDL_VERSION_ATLEAST(2,0,16)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_FlashWindow is not supported before SDL 2.0.16") +#pragma message("SDL_SetWindowAlwaysOnTop is not supported before SDL 2.0.16") +#pragma message("SDL_SetWindowKeyboardGrab is not supported before SDL 2.0.16") +#endif + +typedef enum +{ + SDL_FLASH_CANCEL, // Cancel any window flash state + SDL_FLASH_BRIEFLY, // Flash the window briefly to get attention + SDL_FLASH_UNTIL_FOCUSED, // Flash the window until it gets focus +} SDL_FlashOperation; + +static int SDL_FlashWindow(SDL_Window * window, SDL_FlashOperation operation) +{ + return -1; +} + +static void SDL_SetWindowAlwaysOnTop(SDL_Window * window, SDL_bool on_top) +{ + return; +} + +static void SDL_SetWindowKeyboardGrab(SDL_Window * window, SDL_bool grabbed) +{ + return; +} + +#endif + +#if !(SDL_VERSION_ATLEAST(2,0,18)) + +#if defined(WARN_OUTDATED) +#pragma message("SDL_GetWindowICCProfile is not supported before SDL 2.0.18") +#pragma message("SDL_SetWindowMouseRect is not supported before SDL 2.0.18") +#pragma message("SDL_GetWindowMouseRect is not supported before SDL 2.0.18") +#endif + +#define SDL_WINDOWEVENT_ICCPROF_CHANGED (17) // The ICC profile of the window's display has changed. +#define SDL_WINDOWEVENT_DISPLAY_CHANGED (18) // Window has been moved to display data1. + +static void* SDLCALL SDL_GetWindowICCProfile(SDL_Window * window, size_t* size) +{ + return NULL; +} + +static int SDL_SetWindowMouseRect(SDL_Window * window, const SDL_Rect * rect) +{ + return -1; +} + +static const SDL_Rect * SDLCALL SDL_GetWindowMouseRect(SDL_Window * window) +{ + return NULL; +} + +#endif */ import "C" import "unsafe" @@ -203,23 +264,25 @@ const ( // An enumeration of window events. // (https://wiki.libsdl.org/SDL_WindowEventID) const ( - WINDOWEVENT_NONE = C.SDL_WINDOWEVENT_NONE // (never used) - WINDOWEVENT_SHOWN = C.SDL_WINDOWEVENT_SHOWN // window has been shown - WINDOWEVENT_HIDDEN = C.SDL_WINDOWEVENT_HIDDEN // window has been hidden - WINDOWEVENT_EXPOSED = C.SDL_WINDOWEVENT_EXPOSED // window has been exposed and should be redrawn - WINDOWEVENT_MOVED = C.SDL_WINDOWEVENT_MOVED // window has been moved to data1, data2 - WINDOWEVENT_RESIZED = C.SDL_WINDOWEVENT_RESIZED // window has been resized to data1xdata2; this event is always preceded by WINDOWEVENT_SIZE_CHANGED - WINDOWEVENT_SIZE_CHANGED = C.SDL_WINDOWEVENT_SIZE_CHANGED // window size has changed, either as a result of an API call or through the system or user changing the window size; this event is followed by WINDOWEVENT_RESIZED if the size was changed by an external event, i.e. the user or the window manager - WINDOWEVENT_MINIMIZED = C.SDL_WINDOWEVENT_MINIMIZED // window has been minimized - WINDOWEVENT_MAXIMIZED = C.SDL_WINDOWEVENT_MAXIMIZED // window has been maximized - WINDOWEVENT_RESTORED = C.SDL_WINDOWEVENT_RESTORED // window has been restored to normal size and position - WINDOWEVENT_ENTER = C.SDL_WINDOWEVENT_ENTER // window has gained mouse focus - WINDOWEVENT_LEAVE = C.SDL_WINDOWEVENT_LEAVE // window has lost mouse focus - WINDOWEVENT_FOCUS_GAINED = C.SDL_WINDOWEVENT_FOCUS_GAINED // window has gained keyboard focus - WINDOWEVENT_FOCUS_LOST = C.SDL_WINDOWEVENT_FOCUS_LOST // window has lost keyboard focus - WINDOWEVENT_CLOSE = C.SDL_WINDOWEVENT_CLOSE // the window manager requests that the window be closed - WINDOWEVENT_TAKE_FOCUS = C.SDL_WINDOWEVENT_TAKE_FOCUS // window is being offered a focus (should SDL_SetWindowInputFocus() on itself or a subwindow, or ignore) (>= SDL 2.0.5) - WINDOWEVENT_HIT_TEST = C.SDL_WINDOWEVENT_HIT_TEST // window had a hit test that wasn't SDL_HITTEST_NORMAL (>= SDL 2.0.5) + WINDOWEVENT_NONE = C.SDL_WINDOWEVENT_NONE // (never used) + WINDOWEVENT_SHOWN = C.SDL_WINDOWEVENT_SHOWN // window has been shown + WINDOWEVENT_HIDDEN = C.SDL_WINDOWEVENT_HIDDEN // window has been hidden + WINDOWEVENT_EXPOSED = C.SDL_WINDOWEVENT_EXPOSED // window has been exposed and should be redrawn + WINDOWEVENT_MOVED = C.SDL_WINDOWEVENT_MOVED // window has been moved to data1, data2 + WINDOWEVENT_RESIZED = C.SDL_WINDOWEVENT_RESIZED // window has been resized to data1xdata2; this event is always preceded by WINDOWEVENT_SIZE_CHANGED + WINDOWEVENT_SIZE_CHANGED = C.SDL_WINDOWEVENT_SIZE_CHANGED // window size has changed, either as a result of an API call or through the system or user changing the window size; this event is followed by WINDOWEVENT_RESIZED if the size was changed by an external event, i.e. the user or the window manager + WINDOWEVENT_MINIMIZED = C.SDL_WINDOWEVENT_MINIMIZED // window has been minimized + WINDOWEVENT_MAXIMIZED = C.SDL_WINDOWEVENT_MAXIMIZED // window has been maximized + WINDOWEVENT_RESTORED = C.SDL_WINDOWEVENT_RESTORED // window has been restored to normal size and position + WINDOWEVENT_ENTER = C.SDL_WINDOWEVENT_ENTER // window has gained mouse focus + WINDOWEVENT_LEAVE = C.SDL_WINDOWEVENT_LEAVE // window has lost mouse focus + WINDOWEVENT_FOCUS_GAINED = C.SDL_WINDOWEVENT_FOCUS_GAINED // window has gained keyboard focus + WINDOWEVENT_FOCUS_LOST = C.SDL_WINDOWEVENT_FOCUS_LOST // window has lost keyboard focus + WINDOWEVENT_CLOSE = C.SDL_WINDOWEVENT_CLOSE // the window manager requests that the window be closed + WINDOWEVENT_TAKE_FOCUS = C.SDL_WINDOWEVENT_TAKE_FOCUS // window is being offered a focus (should SDL_SetWindowInputFocus() on itself or a subwindow, or ignore) (>= SDL 2.0.5) + WINDOWEVENT_HIT_TEST = C.SDL_WINDOWEVENT_HIT_TEST // window had a hit test that wasn't SDL_HITTEST_NORMAL (>= SDL 2.0.5) + WINDOWEVENT_ICCPROF_CHANGED = C.SDL_WINDOWEVENT_ICCPROF_CHANGED // the ICC profile of the window's display has changed + WINDOWEVENT_DISPLAY_CHANGED = C.SDL_WINDOWEVENT_DISPLAY_CHANGED // window has been moved to display data1 ) // Window position flags. @@ -294,6 +357,17 @@ const ( GL_CONTEXT_RESET_ISOLATION_FLAG = C.SDL_GL_CONTEXT_RESET_ISOLATION_FLAG // intended to require the GL to make promises about what to do in the face of driver or hardware failure ) +// +// Window flash operation +// +const ( + FLASH_CANCEL FlashOperation = C.SDL_FLASH_CANCEL // Cancel any window flash state + FLASH_BRIEFLY = C.SDL_FLASH_BRIEFLY // Flash the window briefly to get attention + FLASH_UNTIL_FOCUSED = C.SDL_FLASH_UNTIL_FOCUSED // Flash the window until it gets focus +) + +type FlashOperation C.SDL_FlashOperation + // DisplayMode contains the description of a display mode. // (https://wiki.libsdl.org/SDL_DisplayMode) type DisplayMode struct { @@ -959,6 +1033,13 @@ func GLSetSwapInterval(interval int) error { // (https://wiki.libsdl.org/SDL_GL_GetSwapInterval) func GLGetSwapInterval() (int, error) { i := int(C.SDL_GL_GetSwapInterval()) + // -1 means adaptive vsync, not an error + // 0 means vsync off + // 1 means vsync on + if i == -1 || i == 0 || i == 1 { + return i, nil + } + // any other value should be an error return i, errorFromInt(i) } @@ -981,3 +1062,55 @@ func (window *Window) GLSwap() { func GLDeleteContext(context GLContext) { C.SDL_GL_DeleteContext(C.SDL_GLContext(context)) } + +// Flash requests the window to demand attention from the user. +// (https://wiki.libsdl.org/SDL_FlashWindow) +func (window *Window) Flash(operation FlashOperation) (err error) { + return errorFromInt(int(C.SDL_FlashWindow(window.cptr(), C.SDL_FlashOperation(operation)))) +} + +// SetAlwaysOnTop sets the window to always be above the others. +// (https://wiki.libsdl.org/SDL_SetWindowAlwaysOnTop) +func (window *Window) SetAlwaysOnTop(onTop bool) { + C.SDL_SetWindowAlwaysOnTop(window.cptr(), C.SDL_bool(Btoi(onTop))) +} + +// SetKeyboardGrab sets a window's keyboard grab mode. +// (https://wiki.libsdl.org/SDL_GetWindowKeyboardGrab) +func (window *Window) SetKeyboardGrab(grabbed bool) { + C.SDL_SetWindowKeyboardGrab(window.cptr(), C.SDL_bool(Btoi(grabbed))) +} + +// GetICCProfile gets the raw ICC profile data for the screen the window is currently on. +// +// Data returned should be freed with SDL_free. +// +// (https://wiki.libsdl.org/SDL_GetWindowICCProfile) +func (window *Window) GetICCProfile() (iccProfile unsafe.Pointer, size uintptr, err error) { + _size := (*C.size_t)(unsafe.Pointer(&size)) + iccProfile = C.SDL_GetWindowICCProfile(window.cptr(), _size) + if iccProfile == nil { + err = GetError() + } + return +} + +// SetMouseRect confines the cursor to the specified area of a window. +// +// Note that this does NOT grab the cursor, it only defines the area a cursor +// is restricted to when the window has mouse focus. +// +// (https://wiki.libsdl.org/SDL_SetWindowMouseRect) +func (window *Window) SetMouseRect(rect Rect) (err error) { + _rect := (*C.SDL_Rect)(unsafe.Pointer(&rect)) + err = errorFromInt(int(C.SDL_SetWindowMouseRect(window.cptr(), _rect))) + return +} + +// GetMouseRect gets the mouse confinement rectangle of a window. +// (https://wiki.libsdl.org/SDL_GetWindowMouseRect) +func (window *Window) GetMouseRect() (rect Rect) { + _rect := C.SDL_GetWindowMouseRect(window.cptr()) + rect = *((*Rect)(unsafe.Pointer(_rect))) + return +} diff --git a/vendor/github.com/xyproto/sdl2utils/README.md b/vendor/github.com/xyproto/sdl2utils/README.md index ae15e92..fb56c99 100644 --- a/vendor/github.com/xyproto/sdl2utils/README.md +++ b/vendor/github.com/xyproto/sdl2utils/README.md @@ -5,4 +5,4 @@ Helper functions for using SDL2 and Go ## General info * License: BSD -* Version: 0.0.2 +* Version: 0.0.3 diff --git a/vendor/github.com/xyproto/sdl2utils/go.mod b/vendor/github.com/xyproto/sdl2utils/go.mod index cec415e..d3fb9e3 100644 --- a/vendor/github.com/xyproto/sdl2utils/go.mod +++ b/vendor/github.com/xyproto/sdl2utils/go.mod @@ -3,6 +3,6 @@ module github.com/xyproto/sdl2utils go 1.16 require ( - github.com/veandco/go-sdl2 v0.4.8 - github.com/xyproto/pixelpusher v0.0.0-20210812161021-2b0152ae3a90 + github.com/veandco/go-sdl2 v0.4.36 + github.com/xyproto/pixelpusher v1.0.0 ) diff --git a/vendor/github.com/xyproto/sdl2utils/go.sum b/vendor/github.com/xyproto/sdl2utils/go.sum index 15502c0..e6ed8bd 100644 --- a/vendor/github.com/xyproto/sdl2utils/go.sum +++ b/vendor/github.com/xyproto/sdl2utils/go.sum @@ -3,12 +3,15 @@ github.com/fogleman/fauxgl v0.0.0-20200818143847-27cddc103802/go.mod h1:7f7F8EvO github.com/fogleman/simplify v0.0.0-20170216171241-d32f302d5046/go.mod h1:KDwyDqFmVUxUmo7tmqXtyaaJMdGon06y8BD2jmh84CQ= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/veandco/go-sdl2 v0.4.0/go.mod h1:FB+kTpX9YTE+urhYiClnRzpOXbiWgaU3+5F2AB78DPg= -github.com/veandco/go-sdl2 v0.4.8 h1:A26KeX6R1CGt/BQGEov6oxYmVGMMEWDVqTvK1tXvahE= github.com/veandco/go-sdl2 v0.4.8/go.mod h1:OROqMhHD43nT4/i9crJukyVecjPNYYuCofep6SNiAjY= +github.com/veandco/go-sdl2 v0.4.36 h1:Ltydev536rRQodmIrTWFZ3dRp5A+/6t5CYvbi4Kvia0= +github.com/veandco/go-sdl2 v0.4.36/go.mod h1:OROqMhHD43nT4/i9crJukyVecjPNYYuCofep6SNiAjY= github.com/xyproto/multirender v0.0.0-20210812160008-b09d0e851269/go.mod h1:NuGNCBuS6hYRp8HNgzPLELdT4X8n0N3jGcE6MwZfp9E= github.com/xyproto/pf v0.0.0-20181025124322-7074da227fa9/go.mod h1:gFY4ElmPdzIugLXkqXbHZ/5YPyMrApUTDXawHCj9KBI= github.com/xyproto/pf v0.1.0 h1:eRNs6hP2WyPWmf/XLM5GfWm5sEiKzSg0B8wXlN8Rl9I= github.com/xyproto/pf v0.1.0/go.mod h1:rtltCHXE42yF2p802kl3h6ILFdjrGAe+SCmKHFlBl9M= -github.com/xyproto/pixelpusher v0.0.0-20210812161021-2b0152ae3a90 h1:GsvNvObU3y4CeiiQpoi+FOhGw3YKvhiy5iVgvVhg5zQ= github.com/xyproto/pixelpusher v0.0.0-20210812161021-2b0152ae3a90/go.mod h1:0AhWORbB8lGJlDaqQz1RmDmBnk32buv0CsUlKiNrFFI= +github.com/xyproto/pixelpusher v1.0.0 h1:FIqtPz1jHn30/W3ybd0aNDkad1NpcSmyhfvxKMwHIwE= +github.com/xyproto/pixelpusher v1.0.0/go.mod h1:UJcq1T73wPmbcMDDyLZJMAnC9Oy4u7AD8PiaMDVJAuU= github.com/xyproto/sdl2utils v0.0.0-20180825143422-1d41a661b4cb/go.mod h1:/SEUe3Ed5TBJ6kjWqEob0E49WFaAykUUx3WrlIEbl0g= +github.com/xyproto/sdl2utils v0.0.2/go.mod h1:Ht8y1WLQ3Y9peiQ9jsRvP0qdS5R6iYlvD0/SxMMfoqw= diff --git a/vendor/modules.txt b/vendor/modules.txt index 73222ab..0cbcb28 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -6,12 +6,13 @@ github.com/fogleman/simplify # github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 ## explicit github.com/nfnt/resize -# github.com/veandco/go-sdl2 v0.4.10 +# github.com/veandco/go-sdl2 v0.4.36 ## explicit +github.com/veandco/go-sdl2/_libs github.com/veandco/go-sdl2/sdl # github.com/xyproto/pf v0.1.0 ## explicit github.com/xyproto/pf -# github.com/xyproto/sdl2utils v0.0.2 +# github.com/xyproto/sdl2utils v0.0.3 ## explicit github.com/xyproto/sdl2utils