-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Win32: Default to XInput9_1_0.dll #3248
Conversation
Hello,
- Which platform SDK version and MSVC versions have tried this with?
- What happens when other compilation units target other Windows version or Xinput versions?
- Ditto for linking, you state than linking 1.3 and including with 1.4 is problematic, how does using 9_1_0 with different variations of user applications using and linking other versions?
- Afaik DXSDK_DIR is useful for pre 8.0 windows sdk.
Thank you
|
First of all, to provide context to used toolsets and IDEs - I have every Visual Studio from 2008 through 2019 installed on my PC. Therefore, what I see "by default" when opening project files on a clean repository is exactly what they are committed as, without any IDE upgrades.
AFAIK nothing. Multiple XInput versions can be used at once without issues, and it should work fine by default. If somebody needs it to be the other way, they'll have to tailor those examples for their liking but that has to be done at the moment too, so nothing changes.
It's not problematic in the technical sense, but it is problematic in the sense that if you peek at headers, you expect 1.4 to be linked but then the inclusion of
Of course, but the way I see it, project configuration shouldn't be as generic as possible because people integrating imgui in their projects will not use it either way. This is merely a fix to make examples themselves consistent, and since they all target the 8.0 SDK by default, I consider it the target. If users need to change it, they'll need to modify the project either way and so they may as well end up re-adding That said, you technically can still mismatch XInput 1.3 and 1.4, because the way they are picked differs greatly between the Windows SDK XInput and the DXSDK one. For Windows SDK, it is just: #if(_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define XINPUT_DLL_A "xinput1_4.dll"
#define XINPUT_DLL_W L"xinput1_4.dll"
#else
#define XINPUT_DLL_A "xinput9_1_0.dll"
#define XINPUT_DLL_W L"xinput9_1_0.dll"
#endif meanwhile for DXSDK, it is #ifndef XINPUT_USE_9_1_0
#define XINPUT_DLL_A "xinput1_3.dll"
#define XINPUT_DLL_W L"xinput1_3.dll"
#else
#define XINPUT_DLL_A "xinput9_1_0.dll"
#define XINPUT_DLL_W L"xinput9_1_0.dll"
#endif I honestly don't know how to solve this incosistency without using dynamic linking. If the XInput library was loaded by |
LoadLibrary doesn't sound bad either, but given that we already kind of assumed 9.1.0 is already more than enough, why can't you just define |
That's a valid point. The combination of targeting Win7 and |
Updated comments to reflect an updated situation with XInput libs.
523bc60
to
b3c9283
Compare
Updated the PR with the suggestion from @mirh, because it solves the ambiguity of linked XInput libraries completely:
This should allow people to use this sample code in their own projects out of the box without any nasty surprises caused by their project settings. Of course, we only care about the default behaviour here, so it anyone wants to link against xinput1_3 or xinput1_4 instead, they need to edit the code - but that is not surprising, I think. |
Closing this as superseded and fixed by #3646 |
This PR concludes the discussion from #2716.
PR consists of two separable commits, however they are logically related:
DXSDK_DIR
, and turns out they are all useless with the current setup. To avoid such ambiguities, I removed them all.