Files
gMod/header/uMod_IDirect3DTexture9.h
T
DubbleClick ae2c93fc32 1.5.8 (#17)
* remove d3dx9.dll dependency (still requires dx legacy sdk for development, but not for end users)

* fix

* Fix to allow gMod to be loaded as "d3d9.dll"
Don't check for d3d9 functions when checking dll's, its not that deep.
Fix to allow gMod to load "d3d9.dll" using the default method rather than defaulting to system directory

* use d3dx sdk for wic texture loading until we figure out how to load volume/cube textures without it

* fix jons commit

* 1.5.7

* create warning message

* pass correct pointer type, shouldn't matter but lets see

* use Warning instead of Message for failed actions

* need to use d3dpool_managed...

* use specialised methods

* actually do something in the Direct3DCreate9Ex method?

* spaces

* test loading WIC textures with modified WICTextureLoader9.cpp

* include

* Hook into GetProcAddress instead of d3d9 dll

* extern "C" the Direct3DCreate9/Ex functions

* turn on debug messages

* add back in creating of our replacement textures, woopsies

* add messages back in, not loading yet, debug later

* remove SingleTexture stuff

* dont rely on d3dx anymore :)

* Tidied up assertion error box
Added logic to use gmod as d3d9.dll or gmod.dll
Added check to avoid recursive calls to create d3d9

* Remove unused func
2023-11-30 16:57:09 +01:00

53 lines
2.4 KiB
C

#pragma once
#include <d3d9.h>
struct TextureFileStruct;
interface uMod_IDirect3DTexture9 : public IDirect3DTexture9 {
uMod_IDirect3DTexture9(IDirect3DTexture9** ppTex, IDirect3DDevice9* pIDirect3DDevice9)
{
m_D3Dtex = *ppTex; //Texture which will be displayed and will be passed to the game
m_D3Ddev = pIDirect3DDevice9; //device pointer
// fake texture: store the pointer to the original uMod_IDirect3DTexture9 object, needed if a fake texture is unselected
// original texture: stores the pointer to the fake texture object, is needed if original texture is deleted,
// thus the fake texture can also be deleted
}
virtual ~uMod_IDirect3DTexture9()
{
}
// callback interface
IDirect3DTexture9* m_D3Dtex = nullptr;
uMod_IDirect3DTexture9* CrossRef_D3Dtex = nullptr;
IDirect3DDevice9* m_D3Ddev = nullptr;
TextureFileStruct* Reference = nullptr;
HashType Hash = 0u;
bool FAKE = false;
// original interface
STDMETHOD(QueryInterface)(REFIID riid, void** ppvObj) override;
STDMETHOD_(ULONG, AddRef)() override;
STDMETHOD_(ULONG, Release)() override;
STDMETHOD(GetDevice)(IDirect3DDevice9** ppDevice) override;
STDMETHOD(SetPrivateData)(REFGUID refguid,CONST void* pData, DWORD SizeOfData, DWORD Flags) override;
STDMETHOD(GetPrivateData)(REFGUID refguid, void* pData, DWORD* pSizeOfData) override;
STDMETHOD(FreePrivateData)(REFGUID refguid) override;
STDMETHOD_(DWORD, SetPriority)(DWORD PriorityNew) override;
STDMETHOD_(DWORD, GetPriority)() override;
STDMETHOD_(void, PreLoad)() override;
STDMETHOD_(D3DRESOURCETYPE, GetType)() override;
STDMETHOD_(DWORD, SetLOD)(DWORD LODNew) override;
STDMETHOD_(DWORD, GetLOD)() override;
STDMETHOD_(DWORD, GetLevelCount)() override;
STDMETHOD(SetAutoGenFilterType)(D3DTEXTUREFILTERTYPE FilterType) override;
STDMETHOD_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)() override;
STDMETHOD_(void, GenerateMipSubLevels)() override;
STDMETHOD(GetLevelDesc)(UINT Level, D3DSURFACE_DESC* pDesc) override;
STDMETHOD(GetSurfaceLevel)(UINT Level, IDirect3DSurface9** ppSurfaceLevel) override;
STDMETHOD(LockRect)(UINT Level, D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect, DWORD Flags) override;
STDMETHOD(UnlockRect)(UINT Level) override;
STDMETHOD(AddDirtyRect)(CONST RECT* pDirtyRect) override;
[[nodiscard]] HashType GetHash() const;
};