window and 2d helpers