3 # Copyright © 2010-2012 Nick Bowler
5 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
6 # This is free software: you are free to do what the fuck you want to.
7 # There is NO WARRANTY, to the extent permitted by law.
9 # A convenient script to download an OpenGL extension specification from the
10 # Khronos registry into the current working directory.
12 IFS=_ extension=(${=1})
18 extension=(GL $extension)
24 name=${(j:_:)extension[3,-1]}
25 fullname=${(j:_:)extension}
27 if [[ -z $api || -z $vendor || -z $name ]]; then
28 printf 'usage: %s extension\n' $0 1>&2
33 http://www.opengl.org/registry/specs/$vendor/$name.txt
34 http://www.opengl.org/registry/specs/$vendor/${api:l}_$name.txt
38 if wget -O $fullname $url; then
39 gzip -f $fullname || exit 1