microsoft / DirectXTK12

The DirectX Tool Kit (aka DirectXTK12) is a collection of helper classes for writing DirectX 12 code in C++
https://walbourn.github.io/directx-tool-kit-for-directx-12/
MIT License
1.48k stars 394 forks source link

Handle the case that a controller could have no user bind to. #18

Closed jicailiu closed 7 years ago

msftclas commented 7 years ago

@jicailiu, Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA. Thanks, Microsoft Pull Request Bot

jicailiu commented 7 years ago

No it returns S_OK and user is nullptr. You can't really return S_FALSE in a WinRT API as it doesn't project to anything for other language.

I'm aware of the bool operator, but I still prefer use =! nullptr as I see it as a way to emphasize I'm doing a pointer check here. I guess it's just a minor personal preference, I can change to use boolean operator if you insist.

jicailiu commented 7 years ago

That's a good point, thanks!