Welcome to Health Care Magic.
Based on the information provided there are three possibilities:-
1. Dislocation of shoulder
2. Rotator cuff injury
Please get an x-ray of your shoulder done , which would rule out dislocation and fracture. If there were to be a fracture , it will cause you intense pain even at rest and the swelling would be much more.
If the x-ray turns out to be normal the possibility of rotator cuff injury ( most probably supraspinatus tendon tear) is highly likely in your case.
Rotator cuff injury can be confirmed by clinical examination and MRI
Please get an X-ray done and consult the doctor with the reports and take treatment accordingly.
Wish you a speedy recovery.