This is a generic camera system to be used as the base for cameras for taking screenshots within games. The main purpose of the system is to hijack the in-game 3D camera by overwriting values in its camera structure with our own values so we can control where the camera is located, it's pitch/yaw/roll values, its FoV and the camera's look vector.
Use minhook (https://github.com/TsudaKageyu/minhook/) to intercept XInput's XInputGetState() and the 4 message retrieve functions in User32 (GetMessage and peek message and variants). In the detour functions (our own versions) do the following:
Always first call the original ones (trampoline versions).
For the message functions: Handle messages there. Do it in all functions, as it might be the host only calls peek or only get. If input blocking is enabled, return WM_NULL to make the function result in a NOP for the host, otherwise simply return the result of the call to the original version
For XInputGetState, first call the original. Store the result as the next result to use for our Gamepad.cpp code. If input is blocked, simply zero the block returned from the original, otherwise return the block returned from the original.
If input is blocked, any mouse / keyboard message received in the detour versions has to be replaced by WM_NULL. See reshade's input.cpp for ideas how to do that.
Additional work
register the main window for rawinput. It might be that's not done by the host. We need raw input for our own input.
handle mouse and keyboard raw input as our main input for mouse/keyboard. Tombraider camera has mouse raw input handling (so we can port that to the main src) but not raw keyboard handling: it relies on GetKeyState(). This might be sufficient, test whether this is needed.
Use minhook (https://github.com/TsudaKageyu/minhook/) to intercept XInput's XInputGetState() and the 4 message retrieve functions in User32 (GetMessage and peek message and variants). In the detour functions (our own versions) do the following:
Additional work