ReactOS 0.4.16-dev-334-g4d9f67c
d3d9_mipmap.c File Reference
#include "d3d9_mipmap.h"
#include "debug.h"
#include "d3d9_texture.h"
#include "d3d9_device.h"
#include "d3d9_helpers.h"
#include <d3d9.h>
Include dependency graph for d3d9_mipmap.c:

Go to the source code of this file.

Macros

#define LOCK_D3DDEVICE9()   D3D9BaseObject_LockDevice(&This->BaseTexture.BaseResource.BaseObject)
 
#define UNLOCK_D3DDEVICE9()   D3D9BaseObject_UnlockDevice(&This->BaseTexture.BaseResource.BaseObject)
 

Functions

LPD3D9MIPMAP IDirect3DTexture9ToImpl (LPDIRECT3DTEXTURE9 iface)
 
static HRESULT WINAPI D3D9MipMap_QueryInterface (LPDIRECT3DTEXTURE9 iface, REFIID riid, void **ppvObject)
 
ULONG WINAPI D3D9MipMap_AddRef (LPDIRECT3DTEXTURE9 iface)
 
ULONG WINAPI D3D9MipMap_Release (LPDIRECT3DTEXTURE9 iface)
 
HRESULT WINAPI D3D9MipMap_GetDevice (LPDIRECT3DTEXTURE9 iface, IDirect3DDevice9 **ppDevice)
 
HRESULT WINAPI D3D9MipMap_SetPrivateData (LPDIRECT3DTEXTURE9 iface, REFGUID refguid, CONST void *pData, DWORD SizeOfData, DWORD Flags)
 
HRESULT WINAPI D3D9MipMap_GetPrivateData (LPDIRECT3DTEXTURE9 iface, REFGUID refguid, void *pData, DWORD *pSizeOfData)
 
HRESULT WINAPI D3D9MipMap_FreePrivateData (LPDIRECT3DTEXTURE9 iface, REFGUID refguid)
 
DWORD WINAPI D3D9MipMap_SetPriority (LPDIRECT3DTEXTURE9 iface, DWORD PriorityNew)
 
DWORD WINAPI D3D9MipMap_GetPriority (LPDIRECT3DTEXTURE9 iface)
 
void WINAPI D3D9MipMap_PreLoad (LPDIRECT3DTEXTURE9 iface)
 
D3DRESOURCETYPE WINAPI D3D9MipMap_GetType (LPDIRECT3DTEXTURE9 iface)
 
DWORD WINAPI D3D9MipMap_SetLOD (LPDIRECT3DTEXTURE9 iface, DWORD LODNew)
 
DWORD WINAPI D3D9MipMap_GetLOD (LPDIRECT3DTEXTURE9 iface)
 
DWORD WINAPI D3D9MipMap_GetLevelCount (LPDIRECT3DTEXTURE9 iface)
 
HRESULT WINAPI D3D9MipMap_SetAutoGenFilterType (LPDIRECT3DTEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType)
 
D3DTEXTUREFILTERTYPE WINAPI D3D9MipMap_GetAutoGenFilterType (LPDIRECT3DTEXTURE9 iface)
 
void WINAPI D3D9MipMap_GenerateMipSubLevels (LPDIRECT3DTEXTURE9 iface)
 
HRESULT WINAPI D3D9MipMap_GetLevelDesc (LPDIRECT3DTEXTURE9 iface, UINT Level, D3DSURFACE_DESC *pDesc)
 
HRESULT WINAPI D3D9MipMap_GetSurfaceLevel (LPDIRECT3DTEXTURE9 iface, UINT Level, IDirect3DSurface9 **ppSurfaceLevel)
 
HRESULT WINAPI D3D9MipMap_LockRect (LPDIRECT3DTEXTURE9 iface, UINT Level, D3DLOCKED_RECT *pLockedRect, CONST RECT *pRect, DWORD Flags)
 
HRESULT WINAPI D3D9MipMap_UnlockRect (LPDIRECT3DTEXTURE9 iface, UINT Level)
 
HRESULT WINAPI D3D9MipMap_AddDirtyRect (LPDIRECT3DTEXTURE9 iface, CONST RECT *pDirtyRect)
 
HRESULT CreateD3D9MipMap (DIRECT3DDEVICE9_INT *pDevice, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9 **ppTexture)
 

Variables

static IDirect3DTexture9Vtbl D3D9MipMap_Vtbl
 

Macro Definition Documentation

◆ LOCK_D3DDEVICE9

#define LOCK_D3DDEVICE9 ( )    D3D9BaseObject_LockDevice(&This->BaseTexture.BaseResource.BaseObject)

Definition at line 15 of file d3d9_mipmap.c.

◆ UNLOCK_D3DDEVICE9

#define UNLOCK_D3DDEVICE9 ( )    D3D9BaseObject_UnlockDevice(&This->BaseTexture.BaseResource.BaseObject)

Definition at line 16 of file d3d9_mipmap.c.

Function Documentation

◆ CreateD3D9MipMap()

HRESULT CreateD3D9MipMap ( DIRECT3DDEVICE9_INT pDevice,
UINT  Width,
UINT  Height,
UINT  Levels,
DWORD  Usage,
D3DFORMAT  Format,
D3DPOOL  Pool,
IDirect3DTexture9 **  ppTexture 
)

Definition at line 287 of file d3d9_mipmap.c.

288{
289 LPD3D9MIPMAP pThisTexture;
290 if (FAILED(AlignedAlloc((LPVOID*)&pThisTexture, sizeof(D3D9MipMap))))
291 {
292 DPRINT1("Could not create D3D9MipMap");
293 return E_OUTOFMEMORY;
294 }
295
296 InitDirect3DBaseTexture9(&pThisTexture->BaseTexture, (IDirect3DBaseTexture9Vtbl*)&D3D9MipMap_Vtbl, Usage, Levels, Format, Pool, pDevice, RT_EXTERNAL);
297
298 pThisTexture->lpVtbl = &D3D9MipMap_Vtbl;
299
300 pThisTexture->Usage = Usage;
301 pThisTexture->dwWidth = Width;
302 pThisTexture->dwHeight = Height;
303 pThisTexture->Format = Format;
304
305 *ppTexture = (IDirect3DTexture9*)&pThisTexture->lpVtbl;
306
308 return D3D_OK;
309}
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
Definition: bufpool.h:50
@ RT_EXTERNAL
HRESULT AlignedAlloc(IN OUT LPVOID *ppObject, IN SIZE_T dwSize)
Definition: d3d9_helpers.c:95
static IDirect3DTexture9Vtbl D3D9MipMap_Vtbl
Definition: d3d9_mipmap.c:253
void InitDirect3DBaseTexture9(Direct3DBaseTexture9_INT *pBaseTexture, IDirect3DBaseTexture9Vtbl *pVtbl, DWORD Usage, UINT Levels, D3DFORMAT Format, D3DPOOL Pool, struct _Direct3DDevice9_INT *pDevice, enum REF_TYPE RefType)
Definition: d3d9_texture.c:22
#define D3D_OK
Definition: d3d.h:106
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
FxDevice * pDevice
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:384
#define FAILED(hr)
Definition: intsafe.h:51
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88

Referenced by IDirect3DDevice9Base_CreateTexture().

◆ D3D9MipMap_AddDirtyRect()

HRESULT WINAPI D3D9MipMap_AddDirtyRect ( LPDIRECT3DTEXTURE9  iface,
CONST RECT pDirtyRect 
)

Definition at line 246 of file d3d9_mipmap.c.

247{
249 return D3D_OK;
250}

◆ D3D9MipMap_AddRef()

ULONG WINAPI D3D9MipMap_AddRef ( LPDIRECT3DTEXTURE9  iface)

Definition at line 46 of file d3d9_mipmap.c.

47{
49 return D3D9BaseObject_AddRef(&This->BaseTexture.BaseResource.BaseObject);
50}
ULONG D3D9BaseObject_AddRef(D3D9BaseObject *pBaseObject)
LPD3D9MIPMAP IDirect3DTexture9ToImpl(LPDIRECT3DTEXTURE9 iface)
Definition: d3d9_mipmap.c:19

◆ D3D9MipMap_FreePrivateData()

HRESULT WINAPI D3D9MipMap_FreePrivateData ( LPDIRECT3DTEXTURE9  iface,
REFGUID  refguid 
)

Definition at line 114 of file d3d9_mipmap.c.

115{
117 return D3D_OK;
118}

◆ D3D9MipMap_GenerateMipSubLevels()

void WINAPI D3D9MipMap_GenerateMipSubLevels ( LPDIRECT3DTEXTURE9  iface)

Definition at line 216 of file d3d9_mipmap.c.

217{
219}

◆ D3D9MipMap_GetAutoGenFilterType()

D3DTEXTUREFILTERTYPE WINAPI D3D9MipMap_GetAutoGenFilterType ( LPDIRECT3DTEXTURE9  iface)

Definition at line 210 of file d3d9_mipmap.c.

211{
213 return D3D9Texture_GetAutoGenFilterType( (IDirect3DBaseTexture9*)&This->BaseTexture.lpVtbl );
214}
D3DTEXTUREFILTERTYPE WINAPI D3D9Texture_GetAutoGenFilterType(LPDIRECT3DBASETEXTURE9 iface)
Definition: d3d9_texture.c:58

◆ D3D9MipMap_GetDevice()

HRESULT WINAPI D3D9MipMap_GetDevice ( LPDIRECT3DTEXTURE9  iface,
IDirect3DDevice9 **  ppDevice 
)

Definition at line 79 of file d3d9_mipmap.c.

80{
83
84 if (NULL == ppDevice)
85 {
86 DPRINT1("Invalid ppDevice parameter specified");
88 return D3DERR_INVALIDCALL;
89 }
90
91 if (FAILED(D3D9BaseObject_GetDevice(&This->BaseTexture.BaseResource.BaseObject, ppDevice)))
92 {
93 DPRINT1("Invalid This parameter specified");
96 }
97
99 return D3D_OK;
100}
HRESULT D3D9BaseObject_GetDevice(D3D9BaseObject *pBaseObject, IDirect3DDevice9 **ppDevice)
#define UNLOCK_D3DDEVICE9()
Definition: d3d9_mipmap.c:16
#define LOCK_D3DDEVICE9()
Definition: d3d9_mipmap.c:15
#define D3DERR_INVALIDCALL
#define NULL
Definition: types.h:112
#define D3DERR_INVALIDDEVICE
Definition: d3d8.h:86

◆ D3D9MipMap_GetLevelCount()

DWORD WINAPI D3D9MipMap_GetLevelCount ( LPDIRECT3DTEXTURE9  iface)

Definition at line 184 of file d3d9_mipmap.c.

185{
187 return D3D9Texture_GetLevelCount( (IDirect3DBaseTexture9*)&This->BaseTexture.lpVtbl );
188}
DWORD WINAPI D3D9Texture_GetLevelCount(LPDIRECT3DBASETEXTURE9 iface)
Definition: d3d9_texture.c:111

◆ D3D9MipMap_GetLevelDesc()

HRESULT WINAPI D3D9MipMap_GetLevelDesc ( LPDIRECT3DTEXTURE9  iface,
UINT  Level,
D3DSURFACE_DESC pDesc 
)

Definition at line 222 of file d3d9_mipmap.c.

223{
225 return D3D_OK;
226}

◆ D3D9MipMap_GetLOD()

DWORD WINAPI D3D9MipMap_GetLOD ( LPDIRECT3DTEXTURE9  iface)

Definition at line 164 of file d3d9_mipmap.c.

165{
167 return D3D9Texture_GetLOD( (IDirect3DBaseTexture9*)&This->BaseTexture.lpVtbl );
168}
DWORD WINAPI D3D9Texture_GetLOD(LPDIRECT3DBASETEXTURE9 iface)
Definition: d3d9_texture.c:84

◆ D3D9MipMap_GetPriority()

DWORD WINAPI D3D9MipMap_GetPriority ( LPDIRECT3DTEXTURE9  iface)

Definition at line 126 of file d3d9_mipmap.c.

127{
129 return 0;
130}

◆ D3D9MipMap_GetPrivateData()

HRESULT WINAPI D3D9MipMap_GetPrivateData ( LPDIRECT3DTEXTURE9  iface,
REFGUID  refguid,
void pData,
DWORD pSizeOfData 
)

Definition at line 108 of file d3d9_mipmap.c.

109{
111 return D3D_OK;
112}

◆ D3D9MipMap_GetSurfaceLevel()

HRESULT WINAPI D3D9MipMap_GetSurfaceLevel ( LPDIRECT3DTEXTURE9  iface,
UINT  Level,
IDirect3DSurface9 **  ppSurfaceLevel 
)

Definition at line 228 of file d3d9_mipmap.c.

229{
231 return D3D_OK;
232}

◆ D3D9MipMap_GetType()

D3DRESOURCETYPE WINAPI D3D9MipMap_GetType ( LPDIRECT3DTEXTURE9  iface)

Definition at line 138 of file d3d9_mipmap.c.

139{
141 return D3DRTYPE_TEXTURE;
142}
@ D3DRTYPE_TEXTURE
Definition: d3d8types.h:812

◆ D3D9MipMap_LockRect()

HRESULT WINAPI D3D9MipMap_LockRect ( LPDIRECT3DTEXTURE9  iface,
UINT  Level,
D3DLOCKED_RECT pLockedRect,
CONST RECT pRect,
DWORD  Flags 
)

Definition at line 234 of file d3d9_mipmap.c.

235{
237 return D3D_OK;
238}

◆ D3D9MipMap_PreLoad()

void WINAPI D3D9MipMap_PreLoad ( LPDIRECT3DTEXTURE9  iface)

Definition at line 132 of file d3d9_mipmap.c.

133{
135}

◆ D3D9MipMap_QueryInterface()

static HRESULT WINAPI D3D9MipMap_QueryInterface ( LPDIRECT3DTEXTURE9  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 28 of file d3d9_mipmap.c.

29{
31
33 IsEqualGUID(riid, &IID_IDirect3DTexture9) ||
34 IsEqualGUID(riid, &IID_IDirect3DBaseTexture9) ||
35 IsEqualGUID(riid, &IID_IDirect3DResource9))
36 {
37 IUnknown_AddRef(iface);
38 *ppvObject = &This->lpVtbl;
39 return D3D_OK;
40 }
41
42 *ppvObject = NULL;
43 return E_NOINTERFACE;
44}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ D3D9MipMap_Release()

ULONG WINAPI D3D9MipMap_Release ( LPDIRECT3DTEXTURE9  iface)

Definition at line 52 of file d3d9_mipmap.c.

53{
55 return D3D9BaseObject_Release(&This->BaseTexture.BaseResource.BaseObject);
56}
ULONG D3D9BaseObject_Release(D3D9BaseObject *pBaseObject)

◆ D3D9MipMap_SetAutoGenFilterType()

HRESULT WINAPI D3D9MipMap_SetAutoGenFilterType ( LPDIRECT3DTEXTURE9  iface,
D3DTEXTUREFILTERTYPE  FilterType 
)

Definition at line 190 of file d3d9_mipmap.c.

191{
193 return D3D_OK;
194}

◆ D3D9MipMap_SetLOD()

DWORD WINAPI D3D9MipMap_SetLOD ( LPDIRECT3DTEXTURE9  iface,
DWORD  LODNew 
)

Definition at line 144 of file d3d9_mipmap.c.

145{
147 return 0;
148}

◆ D3D9MipMap_SetPriority()

DWORD WINAPI D3D9MipMap_SetPriority ( LPDIRECT3DTEXTURE9  iface,
DWORD  PriorityNew 
)

Definition at line 120 of file d3d9_mipmap.c.

121{
123 return 0;
124}

◆ D3D9MipMap_SetPrivateData()

HRESULT WINAPI D3D9MipMap_SetPrivateData ( LPDIRECT3DTEXTURE9  iface,
REFGUID  refguid,
CONST void pData,
DWORD  SizeOfData,
DWORD  Flags 
)

Definition at line 102 of file d3d9_mipmap.c.

103{
105 return D3D_OK;
106}

◆ D3D9MipMap_UnlockRect()

HRESULT WINAPI D3D9MipMap_UnlockRect ( LPDIRECT3DTEXTURE9  iface,
UINT  Level 
)

Definition at line 240 of file d3d9_mipmap.c.

241{
243 return D3D_OK;
244}

◆ IDirect3DTexture9ToImpl()

LPD3D9MIPMAP IDirect3DTexture9ToImpl ( LPDIRECT3DTEXTURE9  iface)

Definition at line 19 of file d3d9_mipmap.c.

20{
21 if (NULL == iface)
22 return NULL;
23
24 return (LPD3D9MIPMAP)((ULONG_PTR)iface - FIELD_OFFSET(D3D9MipMap, lpVtbl));
25}
#define ULONG_PTR
Definition: config.h:101
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by D3D9MipMap_AddRef(), D3D9MipMap_GetAutoGenFilterType(), D3D9MipMap_GetDevice(), D3D9MipMap_GetLevelCount(), D3D9MipMap_GetLOD(), D3D9MipMap_QueryInterface(), and D3D9MipMap_Release().

Variable Documentation

◆ D3D9MipMap_Vtbl

IDirect3DTexture9Vtbl D3D9MipMap_Vtbl
static

Definition at line 253 of file d3d9_mipmap.c.

Referenced by CreateD3D9MipMap().