Oil and gas didn’t benefit from investor largesse in recent years — but renewables did