iw4x-client/src/Components/Modules/D3D9Ex.cpp

754 lines
26 KiB
C++
Raw Normal View History

2016-01-11 18:48:27 -05:00
#include "STDInclude.hpp"
namespace Components
{
2016-01-12 07:45:19 -05:00
#pragma region D3D9Device
2016-01-11 18:48:27 -05:00
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::QueryInterface(REFIID riid, void** ppvObj)
2016-01-11 18:48:27 -05:00
{
*ppvObj = nullptr;
2016-01-11 18:48:27 -05:00
HRESULT hRes = m_pIDirect3DDevice9->QueryInterface(riid, ppvObj);
2016-01-12 07:45:19 -05:00
if (hRes == NOERROR) *ppvObj = this;
2016-01-11 18:48:27 -05:00
return hRes;
}
ULONG D3D9Ex::D3D9Device::AddRef()
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->AddRef();
2016-01-11 18:48:27 -05:00
}
ULONG D3D9Ex::D3D9Device::Release()
2016-01-11 18:48:27 -05:00
{
ULONG count = m_pIDirect3DDevice9->Release();
2016-01-12 07:45:19 -05:00
if (!count) delete this;
return count;
2016-01-11 18:48:27 -05:00
}
HRESULT D3D9Ex::D3D9Device::TestCooperativeLevel()
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->TestCooperativeLevel();
2016-01-11 18:48:27 -05:00
}
UINT D3D9Ex::D3D9Device::GetAvailableTextureMem()
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetAvailableTextureMem();
2016-01-11 18:48:27 -05:00
}
HRESULT D3D9Ex::D3D9Device::EvictManagedResources()
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->EvictManagedResources();
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetDirect3D(IDirect3D9** ppD3D9)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetDirect3D(ppD3D9);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetDeviceCaps(D3DCAPS9* pCaps)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetDeviceCaps(pCaps);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetDisplayMode(iSwapChain, pMode);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetCreationParameters(pParameters);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
void D3D9Ex::D3D9Device::SetCursorPosition(int X, int Y, DWORD Flags)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetCursorPosition(X, Y, Flags);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
BOOL D3D9Ex::D3D9Device::ShowCursor(BOOL bShow)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->ShowCursor(bShow);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateAdditionalSwapChain(pPresentationParameters, pSwapChain);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetSwapChain(iSwapChain, pSwapChain);
2016-01-11 18:48:27 -05:00
}
UINT D3D9Ex::D3D9Device::GetNumberOfSwapChains()
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetNumberOfSwapChains();
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::Reset(D3DPRESENT_PARAMETERS* pPresentationParameters)
2016-01-11 18:48:27 -05:00
{
return m_pIDirect3DDevice9->Reset(pPresentationParameters);
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion)
2016-01-11 18:48:27 -05:00
{
return m_pIDirect3DDevice9->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetBackBuffer(iSwapChain, iBackBuffer, Type, ppBackBuffer);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetRasterStatus(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetRasterStatus(iSwapChain, pRasterStatus);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetDialogBoxMode(BOOL bEnableDialogs)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetDialogBoxMode(bEnableDialogs);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
void D3D9Ex::D3D9Device::SetGammaRamp(UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetGammaRamp(iSwapChain, Flags, pRamp);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
void D3D9Ex::D3D9Device::GetGammaRamp(UINT iSwapChain, D3DGAMMARAMP* pRamp)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetGammaRamp(iSwapChain, pRamp);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle)
2016-01-11 18:48:27 -05:00
{
if (Pool == D3DPOOL_MANAGED) { Pool = D3DPOOL_DEFAULT; Usage |= D3DUSAGE_DYNAMIC; }
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture, pSharedHandle);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle)
2016-01-11 18:48:27 -05:00
{
if (Pool == D3DPOOL_MANAGED) { Pool = D3DPOOL_DEFAULT; Usage |= D3DUSAGE_DYNAMIC; }
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture, pSharedHandle);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle)
2016-01-11 18:48:27 -05:00
{
if (Pool == D3DPOOL_MANAGED) { Pool = D3DPOOL_DEFAULT; Usage |= D3DUSAGE_DYNAMIC; }
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture, pSharedHandle);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle)
2016-01-11 18:48:27 -05:00
{
if (Pool == D3DPOOL_MANAGED) { Pool = D3DPOOL_DEFAULT; Usage |= D3DUSAGE_DYNAMIC; }
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle)
2016-01-11 18:48:27 -05:00
{
if (Pool == D3DPOOL_MANAGED) { Pool = D3DPOOL_DEFAULT; Usage |= D3DUSAGE_DYNAMIC; }
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer, pSharedHandle);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateRenderTarget(Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateDepthStencilSurface(Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::UpdateSurface(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->UpdateSurface(pSourceSurface, pSourceRect, pDestinationSurface, pDestPoint);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::UpdateTexture(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->UpdateTexture(pSourceTexture, pDestinationTexture);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetRenderTargetData(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetRenderTargetData(pRenderTarget, pDestSurface);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetFrontBufferData(UINT iSwapChain, IDirect3DSurface9* pDestSurface)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetFrontBufferData(iSwapChain, pDestSurface);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::StretchRect(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->StretchRect(pSourceSurface, pSourceRect, pDestSurface, pDestRect, Filter);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::ColorFill(IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->ColorFill(pSurface, pRect, color);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateOffscreenPlainSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle)
2016-01-11 18:48:27 -05:00
{
if (Pool == D3DPOOL_MANAGED) { Pool = D3DPOOL_DEFAULT; }
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateOffscreenPlainSurface(Width, Height, Format, Pool, ppSurface, pSharedHandle);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget)
2016-01-11 18:48:27 -05:00
{
return m_pIDirect3DDevice9->SetRenderTarget(RenderTargetIndex, pRenderTarget);
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetRenderTarget(RenderTargetIndex, ppRenderTarget);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetDepthStencilSurface(pNewZStencil);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetDepthStencilSurface(ppZStencilSurface);
2016-01-11 18:48:27 -05:00
}
HRESULT D3D9Ex::D3D9Device::BeginScene()
2016-01-11 18:48:27 -05:00
{
return m_pIDirect3DDevice9->BeginScene();
}
HRESULT D3D9Ex::D3D9Device::EndScene()
2016-01-11 18:48:27 -05:00
{
return m_pIDirect3DDevice9->EndScene();
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->Clear(Count, pRects, Flags, Color, Z, Stencil);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetTransform(State, pMatrix);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetTransform(State, pMatrix);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->MultiplyTransform(State, pMatrix);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetViewport(CONST D3DVIEWPORT9* pViewport)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetViewport(pViewport);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetViewport(D3DVIEWPORT9* pViewport)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetViewport(pViewport);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetMaterial(CONST D3DMATERIAL9* pMaterial)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetMaterial(pMaterial);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetMaterial(D3DMATERIAL9* pMaterial)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetMaterial(pMaterial);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetLight(DWORD Index, CONST D3DLIGHT9* pLight)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetLight(Index, pLight);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetLight(DWORD Index, D3DLIGHT9* pLight)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetLight(Index, pLight);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::LightEnable(DWORD Index, BOOL Enable)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->LightEnable(Index, Enable);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetLightEnable(DWORD Index, BOOL* pEnable)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetLightEnable(Index, pEnable);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetClipPlane(DWORD Index, CONST float* pPlane)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetClipPlane(Index, pPlane);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetClipPlane(DWORD Index, float* pPlane)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetClipPlane(Index, pPlane);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetRenderState(D3DRENDERSTATETYPE State, DWORD Value)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetRenderState(State, Value);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetRenderState(State, pValue);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateStateBlock(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateStateBlock(Type, ppSB);
2016-01-11 18:48:27 -05:00
}
HRESULT D3D9Ex::D3D9Device::BeginStateBlock()
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->BeginStateBlock();
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::EndStateBlock(IDirect3DStateBlock9** ppSB)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->EndStateBlock(ppSB);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetClipStatus(pClipStatus);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetClipStatus(D3DCLIPSTATUS9* pClipStatus)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetClipStatus(pClipStatus);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetTexture(DWORD Stage, IDirect3DBaseTexture9** ppTexture)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetTexture(Stage, ppTexture);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetTexture(Stage, pTexture);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetTextureStageState(Stage, Type, pValue);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetTextureStageState(Stage, Type, Value);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetSamplerState(Sampler, Type, pValue);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetSamplerState(Sampler, Type, Value);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::ValidateDevice(DWORD* pNumPasses)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->ValidateDevice(pNumPasses);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetPaletteEntries(PaletteNumber, pEntries);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetPaletteEntries(PaletteNumber, pEntries);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetCurrentTexturePalette(UINT PaletteNumber)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetCurrentTexturePalette(PaletteNumber);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetCurrentTexturePalette(UINT *PaletteNumber)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetCurrentTexturePalette(PaletteNumber);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetScissorRect(CONST RECT* pRect)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetScissorRect(pRect);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetScissorRect(RECT* pRect)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetScissorRect(pRect);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetSoftwareVertexProcessing(BOOL bSoftware)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetSoftwareVertexProcessing(bSoftware);
2016-01-11 18:48:27 -05:00
}
BOOL D3D9Ex::D3D9Device::GetSoftwareVertexProcessing()
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetSoftwareVertexProcessing();
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetNPatchMode(float nSegments)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetNPatchMode(nSegments);
2016-01-11 18:48:27 -05:00
}
float D3D9Ex::D3D9Device::GetNPatchMode()
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetNPatchMode();
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->DrawIndexedPrimitive(PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->DrawIndexedPrimitiveUP(PrimitiveType, MinVertexIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer, pVertexDecl, Flags);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateVertexDeclaration(pVertexElements, ppDecl);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetVertexDeclaration(pDecl);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetVertexDeclaration(ppDecl);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetFVF(DWORD FVF)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetFVF(FVF);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetFVF(DWORD* pFVF)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetFVF(pFVF);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateVertexShader(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateVertexShader(pFunction, ppShader);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetVertexShader(IDirect3DVertexShader9* pShader)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetVertexShader(pShader);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetVertexShader(IDirect3DVertexShader9** ppShader)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetVertexShader(ppShader);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetVertexShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetVertexShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetVertexShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetVertexShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetVertexShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetVertexShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetStreamSource(StreamNumber, pStreamData, OffsetInBytes, Stride);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* OffsetInBytes, UINT* pStride)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetStreamSource(StreamNumber, ppStreamData, OffsetInBytes, pStride);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetStreamSourceFreq(UINT StreamNumber, UINT Divider)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetStreamSourceFreq(StreamNumber, Divider);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetStreamSourceFreq(UINT StreamNumber, UINT* Divider)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetStreamSourceFreq(StreamNumber, Divider);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetIndices(IDirect3DIndexBuffer9* pIndexData)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetIndices(pIndexData);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetIndices(IDirect3DIndexBuffer9** ppIndexData)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetIndices(ppIndexData);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreatePixelShader(CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreatePixelShader(pFunction, ppShader);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetPixelShader(IDirect3DPixelShader9* pShader)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetPixelShader(pShader);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetPixelShader(IDirect3DPixelShader9** ppShader)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetPixelShader(ppShader);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetPixelShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount)
2016-01-11 18:48:27 -05:00
{
2017-02-22 13:03:37 -05:00
// Use real bad readptr check here, cause the query takes too long
// TODO: Fix the actual error!
if (IsBadReadPtr(pConstantData, Vector4fCount * 16))
{
//Logger::Print("Invalid shader constant array!\n");
return D3DERR_INVALIDCALL;
}
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetPixelShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetPixelShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetPixelShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::SetPixelShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->SetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::GetPixelShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->GetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->DrawRectPatch(Handle, pNumSegs, pRectPatchInfo);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::DeletePatch(UINT Handle)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->DeletePatch(Handle);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT D3D9Ex::D3D9Device::CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3DDevice9->CreateQuery(Type, ppQuery);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
#pragma endregion
2016-01-11 18:48:27 -05:00
2016-01-12 07:45:19 -05:00
#pragma region D3D9
2016-01-11 18:48:27 -05:00
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::QueryInterface(REFIID riid, void** ppvObj)
2016-01-11 18:48:27 -05:00
{
*ppvObj = nullptr;
2016-01-11 18:48:27 -05:00
HRESULT hRes = m_pIDirect3D9->QueryInterface(riid, ppvObj);
2016-01-12 07:45:19 -05:00
if (hRes == NOERROR)
2016-01-11 18:48:27 -05:00
{
*ppvObj = this;
}
return hRes;
}
ULONG __stdcall D3D9Ex::D3D9::AddRef()
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->AddRef();
2016-01-11 18:48:27 -05:00
}
ULONG __stdcall D3D9Ex::D3D9::Release()
2016-01-11 18:48:27 -05:00
{
ULONG count = m_pIDirect3D9->Release();
2016-01-12 07:45:19 -05:00
if (!count) delete this;
return count;
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::RegisterSoftwareDevice(void* pInitializeFunction)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->RegisterSoftwareDevice(pInitializeFunction);
2016-01-11 18:48:27 -05:00
}
UINT __stdcall D3D9Ex::D3D9::GetAdapterCount()
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->GetAdapterCount();
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->GetAdapterIdentifier(Adapter, Flags, pIdentifier);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
UINT __stdcall D3D9Ex::D3D9::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->GetAdapterModeCount(Adapter, Format);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->EnumAdapterModes(Adapter, Format, Mode, pMode);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->GetAdapterDisplayMode(Adapter, pMode);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::CheckDeviceType(UINT iAdapter, D3DDEVTYPE DevType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->CheckDeviceType(iAdapter, DevType, DisplayFormat, BackBufferFormat, bWindowed);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->CheckDeviceFormat(Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->CheckDeviceMultiSampleType(Adapter, DeviceType, SurfaceFormat, Windowed, MultiSampleType, pQualityLevels);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->CheckDepthStencilMatch(Adapter, DeviceType, AdapterFormat, RenderTargetFormat, DepthStencilFormat);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->CheckDeviceFormatConversion(Adapter, DeviceType, SourceFormat, TargetFormat);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->GetDeviceCaps(Adapter, DeviceType, pCaps);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HMONITOR __stdcall D3D9Ex::D3D9::GetAdapterMonitor(UINT Adapter)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
return m_pIDirect3D9->GetAdapterMonitor(Adapter);
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
HRESULT __stdcall D3D9Ex::D3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface)
2016-01-11 18:48:27 -05:00
{
2016-01-12 07:45:19 -05:00
HRESULT hres = m_pIDirect3D9->CreateDevice(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface);
*ppReturnedDeviceInterface = new D3D9Ex::D3D9Device(*ppReturnedDeviceInterface);
2016-01-12 07:45:19 -05:00
return hres;
2016-01-11 18:48:27 -05:00
}
2016-01-12 07:45:19 -05:00
#pragma endregion
2016-01-11 18:48:27 -05:00
IDirect3D9* __stdcall D3D9Ex::Direct3DCreate9Stub(UINT sdk)
{
if (Dvar::Var("r_useD3D9Ex").get<bool>())
2016-01-11 18:48:27 -05:00
{
IDirect3D9Ex* test;
Direct3DCreate9Ex(sdk, &test);
2016-01-12 07:45:19 -05:00
return (new D3D9Ex::D3D9(test));
2016-01-11 18:48:27 -05:00
}
else
{
return Direct3DCreate9(sdk);
}
}
D3D9Ex::D3D9Ex()
{
2016-01-12 07:45:19 -05:00
Dvar::Register<bool>("r_useD3D9Ex", true, Game::dvar_flag::DVAR_FLAG_SAVED, "Use extended d3d9 interface!");
2016-01-11 18:48:27 -05:00
2016-01-12 07:45:19 -05:00
// Hook Interface creation
2016-01-11 18:48:27 -05:00
Utils::Hook::Set(0x6D74D0, D3D9Ex::Direct3DCreate9Stub);
}
}