mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-05 11:44:53 +01:00
Moved every platform specific code to their own folder
This commit is contained in:
parent
dd13377be7
commit
1785ae6eaf
37 changed files with 9 additions and 1460 deletions
50
overlay_experimental/windows/Windows_Hook.h
Normal file
50
overlay_experimental/windows/Windows_Hook.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#ifndef __INCLUDED_WINDOWS_HOOK_H__
|
||||
#define __INCLUDED_WINDOWS_HOOK_H__
|
||||
|
||||
#include "../Base_Hook.h"
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#ifndef NO_OVERLAY
|
||||
|
||||
class Windows_Hook : public Base_Hook
|
||||
{
|
||||
public:
|
||||
static constexpr const char* DLL_NAME = "user32.dll";
|
||||
|
||||
private:
|
||||
static Windows_Hook* _inst;
|
||||
|
||||
// Variables
|
||||
bool hooked;
|
||||
bool initialized;
|
||||
HWND _game_hwnd;
|
||||
WNDPROC _game_wndproc;
|
||||
|
||||
// Functions
|
||||
Windows_Hook();
|
||||
|
||||
// Hook to Windows window messages
|
||||
decltype(GetRawInputBuffer)* GetRawInputBuffer;
|
||||
decltype(GetRawInputData)* GetRawInputData;
|
||||
|
||||
static LRESULT CALLBACK HookWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
static UINT WINAPI MyGetRawInputBuffer(PRAWINPUT pData, PUINT pcbSize, UINT cbSizeHeader);
|
||||
static UINT WINAPI MyGetRawInputData(HRAWINPUT hRawInput, UINT uiCommand, LPVOID pData, PUINT pcbSize, UINT cbSizeHeader);
|
||||
|
||||
public:
|
||||
virtual ~Windows_Hook();
|
||||
|
||||
void resetRenderState();
|
||||
void prepareForOverlay(HWND);
|
||||
|
||||
HWND GetGameHwnd() const;
|
||||
WNDPROC GetGameWndProc() const;
|
||||
|
||||
bool start_hook();
|
||||
static Windows_Hook* Inst();
|
||||
virtual const char* get_lib_name() const;
|
||||
};
|
||||
|
||||
#endif//NO_OVERLAY
|
||||
#endif//__WINDOWS__
|
||||
#endif//__INCLUDED_WINDOWS_HOOK_H__
|
||||
Loading…
Add table
Add a link
Reference in a new issue