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

DX9 ImGui unresponsive #137

Open
vars1ty opened this issue Nov 3, 2023 · 3 comments
Open

DX9 ImGui unresponsive #137

vars1ty opened this issue Nov 3, 2023 · 3 comments
Labels

Comments

@vars1ty
Copy link
Contributor

vars1ty commented Nov 3, 2023

The DirectX9 ImGui doesn't react nor detect proper mouse position in the same game as in #132.
It logs the position as "100, 100" and never recognizes any change, apart from sudden 1-frame drops to like 0, 0.

Code is the sample code from examples.

@veeenu
Copy link
Owner

veeenu commented Nov 13, 2023

I can't work on this at the moment, but could you try deleting the first #[cfg] statement and the entirety of the second block here?

hudhook/src/hooks/dx9.rs

Lines 39 to 51 in bebcddc

#[cfg(any(target_arch = "aarch64", target_arch = "x86_64"))]
let wnd_proc = std::mem::transmute::<_, WndProcType>(SetWindowLongPtrA(
renderer.get_hwnd(),
GWLP_WNDPROC,
imgui_wnd_proc as usize as isize,
));
#[cfg(target_arch = "x86")]
let wnd_proc = std::mem::transmute::<_, WndProcType>(SetWindowLongA(
renderer.get_hwnd(),
GWLP_WNDPROC,
imgui_wnd_proc as usize as i32,
));

So that only this part remains:

hudhook/src/hooks/dx9.rs

Lines 40 to 44 in bebcddc

let wnd_proc = std::mem::transmute::<_, WndProcType>(SetWindowLongPtrA(
renderer.get_hwnd(),
GWLP_WNDPROC,
imgui_wnd_proc as usize as isize,
));

Let me know if that fixes things; in that case, please open a PR so I can merge that in.

@vars1ty
Copy link
Contributor Author

vars1ty commented Dec 2, 2023

Hi, sorry for the late response, been busy.
I tried that just now, and it makes no difference from what I can tell.
The game in question is an offline RPG which does some very weird hacky things to its window, here it is if you'd like to take a look when you've got the time: https://archive.org/download/star-stable-win-iso-en.-cz.-fi.-hu.-de.-no.-se_202011/Star_Stable_Win_ISO_EN.CZ.FI.HU.DE.NO.SE.zip

@veeenu
Copy link
Owner

veeenu commented Dec 5, 2023

No worries!

In all honesty, I'm not sure we should support programs which have weird unintended usages of the windows API, sounds like a game of cat and mouse against an API surface which is already difficult to work with. I'll give it a try though!

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

No branches or pull requests

2 participants