mirror of
https://github.com/gwdevhub/gMod.git
synced 2026-07-15 23:19:30 +00:00
a7e36fc965
* remove GUI parts as those will not be updated * move to header/source * add cmakelist to create solution * Change Readme * Implement modlist.txt loading * Setup versioning and CD pipeline * Setup DirectX in pipeline * Make uMod load from uMod.dll directory * Fix file loading * Remove break * Fix CD pipeline (#1) * Test cd pipeline * See what's in Lib directory * See inside lib/x86 * Manually adjust the build environment * Disable CD pipeline in PRs Create CI pipeline * Fix slashes in path * Fix build call * Attempt to fix paths * Copy dx headers inside the /header folder * Use ps * Change cache location * Path changes * Improve CMake to look for lib and header files * Fix missing Lib folder * Move changes to CD pipeline * Disable CI on merge and fix CD (#2) * Fix CD tag (#4) * Hijack existing DirectX calls (#5) * Create a dll without listener (#6) * Fix asset creation in CD pipeline (#7) * Setup file loading * create necessary files * merge latest changes, set output dir * Change main to master in pipelines Add fallback for DX libs in CMakeLists * Setup new generator * formatting * remove listener * Change CD to pick the dll from bin Change release name to gMod * more formatting * add editorconfig * Setup versioning * Remove CODEOWNERS --------- Co-authored-by: Alex Macocian <amacocian@yahoo.com>
49 lines
2.0 KiB
C++
49 lines
2.0 KiB
C++
#include "uMod_Main.h"
|
|
|
|
#define IDirect3D9 IDirect3D9Ex
|
|
#define uMod_IDirect3D9 uMod_IDirect3D9Ex
|
|
#define m_pIDirect3D9 m_pIDirect3D9Ex
|
|
#define PRE_MESSAGE "uMod_IDirect3D9Ex"
|
|
|
|
// ReSharper disable once CppUnusedIncludeDirective
|
|
#include "uMod_IDirect3D9.cpp"
|
|
|
|
HRESULT __stdcall uMod_IDirect3D9Ex::CreateDeviceEx(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode,
|
|
IDirect3DDevice9Ex** ppReturnedDeviceInterface)
|
|
{
|
|
Message("uMod_IDirect3D9Ex::CreateDeviceEx: %lu\n", this);
|
|
// we intercept this call and provide our own "fake" Device Object
|
|
const HRESULT hres = m_pIDirect3D9Ex->CreateDeviceEx(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, ppReturnedDeviceInterface);
|
|
|
|
int count = 1;
|
|
if (pPresentationParameters != nullptr) {
|
|
count = pPresentationParameters->BackBufferCount;
|
|
}
|
|
const auto pIDirect3DDevice9Ex = new uMod_IDirect3DDevice9Ex(*ppReturnedDeviceInterface, uMod_Server, count);
|
|
|
|
// store our pointer (the fake one) for returning it to the calling program
|
|
*ppReturnedDeviceInterface = pIDirect3DDevice9Ex;
|
|
|
|
return hres;
|
|
}
|
|
|
|
HRESULT __stdcall uMod_IDirect3D9Ex::EnumAdapterModesEx(UINT Adapter, const D3DDISPLAYMODEFILTER* pFilter, UINT Mode, D3DDISPLAYMODEEX* pMode)
|
|
{
|
|
return m_pIDirect3D9Ex->EnumAdapterModesEx(Adapter, pFilter, Mode, pMode);
|
|
}
|
|
|
|
HRESULT __stdcall uMod_IDirect3D9Ex::GetAdapterDisplayModeEx(UINT Adapter, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation)
|
|
{
|
|
return m_pIDirect3D9Ex->GetAdapterDisplayModeEx(Adapter, pMode, pRotation);
|
|
}
|
|
|
|
HRESULT __stdcall uMod_IDirect3D9Ex::GetAdapterLUID(UINT Adapter, LUID* pLUID)
|
|
{
|
|
return m_pIDirect3D9Ex->GetAdapterLUID(Adapter, pLUID);
|
|
}
|
|
|
|
UINT __stdcall uMod_IDirect3D9Ex::GetAdapterModeCountEx(UINT Adapter, const D3DDISPLAYMODEFILTER* pFilter)
|
|
{
|
|
return m_pIDirect3D9Ex->GetAdapterModeCountEx(Adapter, pFilter);
|
|
}
|