Copied most of ShaderTools.cpp to glTools.cpp