Optimize the switch

using an array to store the cases by their WebGl GLEnum value
http://jsperf.com/if-switch-lookup-table