replacing gl function calls with of