sync up with glxgears.c from master