Skip to content
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

Backends: Win32: dynamically load XInput library #3646

Closed
wants to merge 1 commit into from

Conversation

Demonese
Copy link
Contributor

@Demonese Demonese commented Dec 9, 2020

See: #3645
Related Pull Request:#3248

@ocornut
Copy link
Owner

ocornut commented Dec 9, 2020

Thank you @Demonese.
This looks good but I'm not going to merge asap as I'm aiming to tag 1.80 soon and don't want to introduce unknown there, but this should be good for 1.81.

I noticed your fixed the batch file, thanks! This was indeed overlooked by b1a18d8 and I've now fixed it with 3346544 (your PR will conflict because of it, but you can remove the modification to the .bat file and rebase over master + force push if you want, otherwise I'll do it when merging).

I think if you keep XINPUT_STATE xinput_state; on the stack as this was the patch would not need to add the extra indentation in ImGui_ImplWin32_UpdateGamepads().

Thanks again!

@Demonese
Copy link
Contributor Author

@ocornut Ok, it's all right now. I will keep this PR up to date because my project is using this improvement.

@Demonese Demonese force-pushed the dynamic_xinput branch 2 times, most recently from 0ae6692 to 228a697 Compare December 18, 2020 05:58
@Demonese Demonese force-pushed the dynamic_xinput branch 2 times, most recently from 125028f to 4a8c505 Compare December 28, 2020 07:08
@ocornut ocornut added this to the v1.81 milestone Jan 5, 2021
@Demonese Demonese force-pushed the dynamic_xinput branch 3 times, most recently from eb43ce7 to 6d2c7be Compare January 23, 2021 04:05
@Demonese
Copy link
Contributor Author

😋I refer to GLFW's implementation and added searches for XInput1_1.dll and XInput1_2.dll. I also added some cleanup code (line 151-155, maybe you forgot them? @ocornut ):
image

@ocornut
Copy link
Owner

ocornut commented Jan 25, 2021

Now merged this, thank you @Demonese!

Your commit 633d103 + various minor amends f139846 (using LoadLibraryA as used elsewhere in the file, moved xinput state back to the stack is simpled and shorter, fixed spacing and minor coding style fixes).

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants