Is there anyway to use the boiler in my house as a pool heater? Has anyone done this?

If I install a natural gas pool heater, does it need to be some distance away from the house or could it go in a covered area under a high deck?

Thanks for any advice. I live in NY and I'm tired of only being able to use the pool 6 months a year. I have an inground pool.