Not knowing what is going on is worse than knowing! And, texting is non personal as you can’t really get a feel of the other person texting, it’s too easy to take something the wrong way or out of context. I’m kind of in the same boat as you, different circumstances but the feelings of confusion and pain are the same.
Sooner rather than later you need to either make peace with how things are and make yourself care less (invest less emotion and effort into him and the friendship) so he won’t have such an affect on your moods and emotions (I know, been there, it sucks!) or decide if it’s worth having him as a friend this way. Ask yourself what you are getting out of it.
It’s really hard to be ‘friends’ with someone you love/have a crush on, or if you’ve broken up and trying to be just friends.