What Oscar said. Also, you dont have SPOFS in the loop to change x and y, you also need a VSYNC.