Texture: Found the bug in flipSurface, the wrong pointers were being compared and it's a wonder the function ever worked at all.