Confused and need help

So me and my ex broke up and he started talking to this other girl. When I found out I was so upset and angry so I decided to go over my guy best friends house bc we always have fun and laugh when we hang out and I needed to cheer up. An hour or so goes by and were smoking weed but I smoked a lot more than I usually do to the point were I wasn't really in control over myself after we smoked we went and watched a movie on his bed(we have before and nothing's ever happened) but this time he started coming on to me, kissing me and touch my thighs and feeling on me and then he pulled down my pants and just started having sex w me....I didn't really stop it or anything bc I was just so upset about my ex and high I couldn't think straight but now my ex is trying to get back with me and is trying really hard to be with me....I'm just not sure what to do, is it ok that happened since we weren't dating?should I tell my ex what happened or does he not need to know?& was it ok for me and one of my closest friends to do that? I just don't really know what to think