Change to generic window drawing function