Commit Graph

22 Commits

Author SHA1 Message Date
Nemirtingas
9b178146c4 Cleaned a bit hooks and added sanity checks. 2019-08-26 19:36:07 +02:00
Nemirtingas
dd530e80b1 Now passing to hooks device object.
Added Base_Hook::get_lib_name to track what renderer is hooked for overlay.
Objects used to detect renderer type are now also used to hook the rendering functions. So we don't have to build another device.
Updated VTables for DX12.
2019-08-26 16:38:01 +02:00
Nemirtingas
cd8c5fc2ea Fixed memory leak 2019-08-25 21:22:25 +02:00
Nemirtingas
42a22dd4bb Don't free objects with shutdown
Some games don't like to free the DX objects after the game has shut down.
2019-08-21 21:52:08 +02:00
Nemirtingas
5a0653d080 Refactor dx device creation
Find the game's window instead of using the foreground window.
2019-08-20 23:27:17 +02:00
Nemirtingas
8757f4a548 Fixed ressource leaks. 2019-08-19 19:51:35 +02:00
Nemirtingas
ca0ef4380a Moved hooks calls and added hook retry
With that change, I no longer re-hook rendering functions as Hook_Manager::FoundRenderer removes all hooks and then we hook the true functions in the renderer specialization.
Added a retry count.
2019-08-18 17:12:57 +02:00
Nemirtingas
5b0306dccc Moved window hooks to its own class
Every class has a job. Overlay is to show an overlay not to hook windows functions.
Hook_Manager's job is to manage hooks and should not contain a reference to the overlay. (It should not contains any reference to directX or OpenGL either but I'll see that later... Maybe)
This makes the overlay code much cleaner and "could" be used in Linux as well.
2019-08-18 16:22:07 +02:00
Nemirtingas
f096a2d8a2 Use LoadLibrary instead of LoadModule
LoadLibrary increase the reference count to the library. So we make sure this library is still loaded when we shut down the hook.
2019-08-18 16:19:28 +02:00
Nemirtingas
5d4b4371f3 Fixed everything that I've forgot 2019-08-16 19:21:30 +02:00
Nemirtingas
d06fbba104 Added error handling when hook fails 2019-08-16 19:10:12 +02:00
Nemirtingas
7b53134512 Initialize overlay after full initialization of UI. 2019-08-16 18:30:55 +02:00
Nemirtingas
05f3fa09b3 Better compatibility for DX10 & DX11
Create a NULL Device (We only need it to retrieve its vtable)
2019-08-16 18:29:49 +02:00
Nemirtingas
40615d07a7 Reworked how renderers are hooked.
Some games doesn't initialise Steam before initalizing their Renderer (even if the doc says to) . So instead of waiting for the game to initialize it, hook to the rendering functions and deduce which implementation should be used.
2019-08-16 10:36:44 +02:00
Nemirtingas
4d3c355fcc Renammed hook_<renderer> to start_hook 2019-08-16 10:31:29 +02:00
Nemirtingas
2fe5e90294 Reworked booleans 2019-08-16 10:28:23 +02:00
Nemirtingas
8abd24ca54 Re-enabled auto join if overlay is not ready 2019-08-16 00:12:11 +02:00
Nemirtingas
d87760b78b Created a define to not compile overlay. 2019-08-14 15:09:57 +02:00
Nemirtingas
56b4e6a7c7 Added preprocessor exclusion for linux 2019-08-14 14:55:31 +02:00
Nemirtingas
7137fae413 Added error checks for renderer hooks
Added errors checks but there are no error correction, If it fails your won't have any overlay at all.
2019-08-02 09:07:53 +02:00
Nemirtingas
631bcf9edf Updated hooks. 2019-08-01 15:47:43 +02:00
Nemirtingas
2ba8cae64e Added DirectX hooks
Warning: DX9 doesn't support resizing (TODO), DX12 has not beed tested and is not finished.
No OpenGL support for now.
2019-07-25 23:21:03 +02:00