ReactOS  0.4.15-dev-499-g1f31905
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 }
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:382
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT AlignedAlloc(IN OUT LPVOID *ppObject, IN SIZE_T dwSize)
Definition: d3d9_helpers.c:95
static IDirect3DTexture9Vtbl D3D9MipMap_Vtbl
Definition: d3d9_mipmap.c:253
Definition: bufpool.h:50
#define D3D_OK
Definition: d3d.h:106
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: debug.h:115
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char * Format
Definition: acpixf.h:1216
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

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 }
#define D3D_OK
Definition: d3d.h:106
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 }
#define D3D_OK
Definition: d3d.h:106
#define UNIMPLEMENTED
Definition: debug.h:115

◆ D3D9MipMap_GenerateMipSubLevels()

void WINAPI D3D9MipMap_GenerateMipSubLevels ( LPDIRECT3DTEXTURE9  iface)

Definition at line 216 of file d3d9_mipmap.c.

217 {
219 }
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 }
LPD3D9MIPMAP IDirect3DTexture9ToImpl(LPDIRECT3DTEXTURE9 iface)
Definition: d3d9_mipmap.c:19
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");
95  return D3DERR_INVALIDDEVICE;
96  }
97 
99  return D3D_OK;
100 }
#define LOCK_D3DDEVICE9()
Definition: d3d9_mipmap.c:15
LPD3D9MIPMAP IDirect3DTexture9ToImpl(LPDIRECT3DTEXTURE9 iface)
Definition: d3d9_mipmap.c:19
#define D3DERR_INVALIDCALL
#define D3DERR_INVALIDDEVICE
Definition: d3d8.h:86
HRESULT D3D9BaseObject_GetDevice(D3D9BaseObject *pBaseObject, IDirect3DDevice9 **ppDevice)
smooth NULL
Definition: ftsmooth.c:416
#define D3D_OK
Definition: d3d.h:106
#define DPRINT1
Definition: precomp.h:8
#define UNLOCK_D3DDEVICE9()
Definition: d3d9_mipmap.c:16

◆ 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
LPD3D9MIPMAP IDirect3DTexture9ToImpl(LPDIRECT3DTEXTURE9 iface)
Definition: d3d9_mipmap.c:19

◆ 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 }
#define D3D_OK
Definition: d3d.h:106
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 }
LPD3D9MIPMAP IDirect3DTexture9ToImpl(LPDIRECT3DTEXTURE9 iface)
Definition: d3d9_mipmap.c:19
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 }
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 }
#define D3D_OK
Definition: d3d.h:106
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 }
#define D3D_OK
Definition: d3d.h:106
#define UNIMPLEMENTED
Definition: debug.h:115

◆ D3D9MipMap_GetType()

D3DRESOURCETYPE WINAPI D3D9MipMap_GetType ( LPDIRECT3DTEXTURE9  iface)

Definition at line 138 of file d3d9_mipmap.c.

139 {
141  return D3DRTYPE_TEXTURE;
142 }
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 }
#define D3D_OK
Definition: d3d.h:106
#define UNIMPLEMENTED
Definition: debug.h:115

◆ D3D9MipMap_PreLoad()

void WINAPI D3D9MipMap_PreLoad ( LPDIRECT3DTEXTURE9  iface)

Definition at line 132 of file d3d9_mipmap.c.

133 {
135 }
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 
32  if (IsEqualGUID(riid, &IID_IUnknown) ||
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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
LPD3D9MIPMAP IDirect3DTexture9ToImpl(LPDIRECT3DTEXTURE9 iface)
Definition: d3d9_mipmap.c:19
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define D3D_OK
Definition: d3d.h:106
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ 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 }
LPD3D9MIPMAP IDirect3DTexture9ToImpl(LPDIRECT3DTEXTURE9 iface)
Definition: d3d9_mipmap.c:19
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 }
#define D3D_OK
Definition: d3d.h:106
#define UNIMPLEMENTED
Definition: debug.h:115

◆ D3D9MipMap_SetLOD()

DWORD WINAPI D3D9MipMap_SetLOD ( LPDIRECT3DTEXTURE9  iface,
DWORD  LODNew 
)

Definition at line 144 of file d3d9_mipmap.c.

145 {
147  return 0;
148 }
#define UNIMPLEMENTED
Definition: debug.h:115

◆ D3D9MipMap_SetPriority()

DWORD WINAPI D3D9MipMap_SetPriority ( LPDIRECT3DTEXTURE9  iface,
DWORD  PriorityNew 
)

Definition at line 120 of file d3d9_mipmap.c.

121 {
123  return 0;
124 }
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 }
#define D3D_OK
Definition: d3d.h:106
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 }
#define D3D_OK
Definition: d3d.h:106
#define UNIMPLEMENTED
Definition: debug.h:115

◆ 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 }
smooth NULL
Definition: ftsmooth.c:416
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define ULONG_PTR
Definition: config.h:101

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().