diff --git a/src/amdgpu.cpp b/src/amdgpu.cpp index 9c5aae9e..4f30d319 100644 --- a/src/amdgpu.cpp +++ b/src/amdgpu.cpp @@ -1,6 +1,8 @@ #include #include +#ifdef __linux__ #include +#endif #include "amdgpu.h" #include "gpu.h" #include "cpu.h" diff --git a/src/cpu.h b/src/cpu.h index 8eed98aa..878cf3f5 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -7,7 +7,9 @@ #include #include #include - +#ifdef WIN32 +#include +#endif #include "timing.hpp" typedef struct CPUData_ { @@ -157,5 +159,7 @@ private: }; extern CPUStats cpuStats; - +#ifdef WIN32 +uint64_t FileTimeToInt64( const FILETIME& ft ); +#endif #endif //MANGOHUD_CPU_H diff --git a/src/logging.cpp b/src/logging.cpp index 08c974b4..046c8476 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -206,9 +206,11 @@ void Logger::stop_logging() { output_file.close(); writeSummary(m_log_files.back()); clear_log_data(); +#ifdef __linux__ control_client_check(HUDElements.params->control, global_control_client, gpu.c_str()); const char * cmd = "LoggingFinished"; control_send(global_control_client, cmd, strlen(cmd), 0, 0); +#endif } void Logger::logging(){ diff --git a/src/win/d3d11_hook.cpp b/src/win/d3d11_hook.cpp index c049b314..948b34d4 100644 --- a/src/win/d3d11_hook.cpp +++ b/src/win/d3d11_hook.cpp @@ -3,7 +3,6 @@ #if KIERO_INCLUDE_D3D11 #include "d3d11_hook.h" -#include #include #include diff --git a/src/win/d3d11_hook.h b/src/win/d3d11_hook.h index d0c1a8e1..c377d2b1 100644 --- a/src/win/d3d11_hook.h +++ b/src/win/d3d11_hook.h @@ -1,6 +1,7 @@ +#pragma once #ifndef __D3D11_IMPL_H__ #define __D3D11_IMPL_H__ - +#include namespace impl { namespace d3d11 @@ -8,6 +9,6 @@ namespace impl void init(); } } - +long __stdcall hkPresent11(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags); #endif // __D3D11_IMPL_H__ \ No newline at end of file diff --git a/src/win/d3d12_hook.h b/src/win/d3d12_hook.h index 7b4de721..65404f59 100644 --- a/src/win/d3d12_hook.h +++ b/src/win/d3d12_hook.h @@ -1,3 +1,4 @@ +#pragma once #include #include #include @@ -16,6 +17,6 @@ namespace impl void init(); } } - +long __fastcall hkPresent12(IDXGISwapChain3* pSwapChain, UINT SyncInterval, UINT Flags); #endif // __D3D12_IMPL_H__ \ No newline at end of file diff --git a/src/win/dxgi.cpp b/src/win/dxgi.cpp index 72c63b05..eb94adca 100644 --- a/src/win/dxgi.cpp +++ b/src/win/dxgi.cpp @@ -1,8 +1,8 @@ #include "kiero.h" #include "windows.h" #include -#include "kiero.h" #include +#include "dxgi.h" #ifdef _UNICODE # define KIERO_TEXT(text) L##text diff --git a/src/win/dxgi.h b/src/win/dxgi.h new file mode 100644 index 00000000..011edf17 --- /dev/null +++ b/src/win/dxgi.h @@ -0,0 +1,2 @@ +#pragma once +uint32_t get_device_id_dxgi(); \ No newline at end of file diff --git a/src/win/main.cpp b/src/win/main.cpp index 8bf81698..84b456f4 100644 --- a/src/win/main.cpp +++ b/src/win/main.cpp @@ -1,8 +1,7 @@ -#include "windows.h" #include #include "kiero.h" #include - +#include "win_shared.h" #if KIERO_INCLUDE_D3D11 # include "d3d11_hook.h" #endif diff --git a/src/win/win_shared.h b/src/win/win_shared.h new file mode 100644 index 00000000..0775d989 --- /dev/null +++ b/src/win/win_shared.h @@ -0,0 +1,6 @@ +#pragma once +#include "windows.h" +void ConsoleSetup(); +void renderTypes(); +int MainThread(); +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID); \ No newline at end of file