implement scanlines for glDrawPixels