optimize double versions of gl funcs