If Microsoft ever needed a dose of the cool, it’s now. Fortunately, the company seems to have gotten the message.

The company’s rollout yesterday of a slew of new features for Windows 10 includes some pretty nifty features — and at least one big surprise.

In addition to a bunch of expected features (such as a single operating system that unifies Windows on tablets and PCs with its phone and the expected addition of the virtual voice-activated assistant Cortana), Microsoft showed off one especially cool thing: Its HoloLens, an augmented-reality headset that superimposes virtual “holographs” over the real world.

Another sign of coolness and integration: Microsoft said yesterday that people who had bought Xbox games would be able to play them on their Windows 10 PCs and tablets, too. If you’re a gamer, that’s pretty cool — and it helps to better integrate Xbox into Microsoft’s overall ecosystem.

The HoloLens has multiple sensors and a custom Microsoft chip called a Holographic Processing Unit to help it understand what you’re looking at and where you are in space. It’s connected to a new Microsoft product called Windows Holographic, which extends that augmented-reality capability to all Windows users. Holographic application programming interfaces (APIs) will be embedded within Windows 10.

Rather than a virtual-reality headset like the Oculus Rift or Samsung Gear VR, which block out the real world and replace it with a virtual one, the HoloLens add things to the real world that only you can see: Virtual display screens on walls, 3D objects you can model on your desktop with hand gestures, or playful little sprites that dance around your furniture as part of a game you’re playing with them.

The videos demonstrating the system are impressive, even if they leave me wondering whether anyone would actually want to use an interface like this once the novelty wears off.

But more important, it shows that Microsoft under Satya Nadella is finally starting to figure out how to pull together its considerable assets into a single, more cohesive whole. That’s something the company has struggled with for years.

“We want to move from people needing Windows, to choosing Windows, to loving Windows,” Nadella said yesterday. “That is our bold goal with Windows.”

Now, Microsoft has never exactly been “cool.” Even Bill Gates became a lot cooler when he left the company he founded, and that’s saying a lot. But with a mature OS business, threats from gigantic competitors, and a lackluster reputation among techies, coolness might be just what Microsoft needs.

As I wrote in October, Microsoft’s last big OS launch wasn’t exactly spectacular. Windows 8 was an ambitious attempt to introduce a new, touch-centric interface while maintaining compatibility with the massive number of old, keyboard-and-mouse Windows applications out there. It didn’t quite flop, selling 200 million copies in its first 15 months, but Microsoft hasn’t released any sales figures for the OS since February, and this is never a good sign. (If sales were good, Microsoft would be bragging about them.)

Worse, Windows 8 (including its incremental upgrade, 8.1) barely shows up in a measure of what kinds of computers people are using to access the Internet. That’s one way of finding out what kinds of computers people are actually using, and the signs aren’t good. Windows 8 and 8.1 currently account for about 12.5 percent of the computers connecting to the Internet, according to NetMarketShare. Windows 7, by contrast, accounts for more than half of the browsing public — while Microsoft’s ancient and long-obsolete OS, Windows XP, still holds more than 24 percent.

Microsoft bet big on the tablet interface with Windows 8, hoping to cash in on the increasing coolness of tablets from 2010-2012, but its bet failed. The new interface was too confusing for people — and tablet sales have actually slackened a bit, suggesting that Microsoft’s bet was poorly timed.

One cautionary note: People — including me — have been making dire predictions about Microsoft for years. It’s important not to lose sight of the fact that more than 85 percent of the desktop computers people are using, according to that NetMarketShare data, are running Microsoft operating systems. (And desktop computers still account for more than 80 percent of overall browsing activity, while tablets and mobile phones have less than 20 percent.) With billions of Windows licenses out there, and robust businesses based on Office, Azure, Xbox, and more, Microsoft isn’t going to quietly fade away any time soon.

But if it can’t capture some of the cool factor, it will have a hard time inspiring employees and customers, and Microsoft will face a long, slow battle against companies like Google and Apple that don’t have such difficulties. That will, over time, erode the company’s dominance, no matter how much of a lead it has now.

Is this week’s news enough to save the company from a long, slow decline into irrelevance? Let’s be clear: The HoloLens alone won’t make the difference between Microsoft undergoing a renaissance and Microsoft fading into a comfortable obscurity.

But as a sign of the company’s more strategic, integrated thinking, it’s promising indeed. And a little cool factor doesn’t hurt at all.