I only tried Viagra recreationally once. Wow it works amazing. Lasted a long time. I remember in one session in my 20's cumming three times in one night with a pretty blonde with nothing but alcohol. I think with Viagra I might be able to do it again. My understanding with this class of drugs they were originally a heart medicine but during testing trials the men reported great erections. It didn't work great for heart problems so they rebranded the drug.
Many things affect the ability to get hard. A couple are phycological, circulation problems, high blood pressure, low test, ulcer medicine, anti depressants, diabetes, drugs to slow prostate enlargement and coming off steroids are a few. Hair growth drugs can also cause it. Have great hair for the ladies but can't get it hard doesn't sound like a good trade off. Blood pressure medicine can be a big cause too.
Also I heard whether it's true or not, too much porn can do it too. I don't care who you are but no one can stay hard for hours. Watching too much porn exhausts the mechanisms that go into the drive for an erection.