bglPolygonOffset(0) was accidentally called without it being set before, causing window matrix to go weird. :)