Skip to content

Instantly share code, notes, and snippets.

@wldomiciano wldomiciano/sdl2-setup.ps1
Last active Aug 26, 2018

Embed
What would you like to do?
Download and install SDL 2 and extra Visual Studio development libraries
Set-PSDebug -off
$SDL2_DIR = "SDL_TEST"
$TEMP = "SDL_TEMP"
$SDL2_VERSIONS = @{
"SDL" = "2.0.7";
"SDL_image" = "2.0.2";
"SDL_mixer" = "2.0.2";
"SDL_net" = "2.0.1";
"SDL_ttf" = "2.0.14"; }
$libs = @(
"https://www.libsdl.org/release/SDL2-devel-$($SDL2_VERSIONS.SDL)-VC.zip",
"https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-$($SDL2_VERSIONS.SDL_IMAGE)-VC.zip",
"https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-$($SDL2_VERSIONS.SDL_MIXER)-VC.zip",
"https://www.libsdl.org/projects/SDL_net/release/SDL2_net-devel-$($SDL2_VERSIONS.SDL_NET)-VC.zip",
"https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-$($SDL2_VERSIONS.SDL_TTF)-VC.zip")
$wc = New-Object System.Net.WebClient
mkdir $TEMP
$libs | % {
$name = $_ -replace "[\w:/\.]*(SDL2[\w]*-devel)[\w-\.]*", '$1'
$out = "$((Get-Item -Path ".\" -Verbose).FullName)\$TEMP\$name.zip"
echo "Downloading $name..."
$wc.DownloadFile($_, $out)
}
echo "Extracting..."
ls $TEMP | % { expand-archive $TEMP\$_ $TEMP }
echo "Moving to SDL2 directory..."
ls $TEMP -directory | % { xcopy /iqsy $TEMP\$_ $SDL2_DIR }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.