ReactOS 0.4.16-dev-91-g764881a
d3d9_callbacks.c File Reference
#include "d3d9_common.h"
#include "d3d9_callbacks.h"
#include <d3d9.h>
#include <dll/directx/d3d8thk.h>
#include "d3d9_private.h"
#include "ddrawi.h"
Include dependency graph for d3d9_callbacks.c:

Go to the source code of this file.

Functions

DWORD WINAPI D3d9GetAvailDriverMemory (LPD3D9_GETAVAILDRIVERMEMORYDATA pData)
 

Function Documentation

◆ D3d9GetAvailDriverMemory()

DWORD WINAPI D3d9GetAvailDriverMemory ( LPD3D9_GETAVAILDRIVERMEMORYDATA  pData)

Definition at line 15 of file d3d9_callbacks.c.

16{
17 DWORD Ret = FALSE;
19 ZeroMemory(&Data, sizeof(Data));
20
21 if (D3D9_GETAVAILDRIVERMEMORY_TYPE_ALL == pData->dwMemoryType)
22 {
23 Data.DDSCaps.dwCaps = DDSCAPS_VIDEOMEMORY;
24 }
25 else if (D3D9_GETAVAILDRIVERMEMORY_TYPE_LOCAL == pData->dwMemoryType)
26 {
28 }
29 else if (D3D9_GETAVAILDRIVERMEMORY_TYPE_NONLOCAL == pData->dwMemoryType)
30 {
32 }
33
34 if (Data.DDSCaps.dwCaps != 0)
35 {
36 if (0 == pData->dwTextureType)
37 Data.DDSCaps.dwCaps |= DDSCAPS_TEXTURE;
38
39 if (pData->dwTextureType & D3D9_TEXTURETYPE_HALSURFACE)
40 Data.DDSCaps.dwCaps |= DDSCAPS_TEXTURE | DDSCAPS_3DDEVICE;
41
42 if (pData->dwTextureType & D3D9_TEXTURETYPE_BACKBUFFER)
43 Data.DDSCaps.dwCaps |= DDSCAPS_ZBUFFER;
44
45 Ret = OsThunkDdGetAvailDriverMemory(pData->pUnknown6BC->hDirectDrawLocal, (DD_GETAVAILDRIVERMEMORYDATA*)&Data);
46 pData->dwFree = Data.dwFree;
47 }
48
49 return Ret;
50}
DWORD WINAPI OsThunkDdGetAvailDriverMemory(HANDLE hDirectDraw, PDD_GETAVAILDRIVERMEMORYDATA puGetAvailDriverMemoryData)
#define D3D9_TEXTURETYPE_BACKBUFFER
#define D3D9_TEXTURETYPE_HALSURFACE
@ D3D9_GETAVAILDRIVERMEMORY_TYPE_LOCAL
@ D3D9_GETAVAILDRIVERMEMORY_TYPE_NONLOCAL
@ D3D9_GETAVAILDRIVERMEMORY_TYPE_ALL
#define FALSE
Definition: types.h:117
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DDSCAPS_ZBUFFER
Definition: ddraw.h:267
#define DDSCAPS_NONLOCALVIDMEM
Definition: ddraw.h:277
#define DDSCAPS_3DDEVICE
Definition: ddraw.h:263
#define DDSCAPS_TEXTURE
Definition: ddraw.h:262
#define DDSCAPS_VIDEOMEMORY
Definition: ddraw.h:264
#define DDSCAPS_LOCALVIDMEM
Definition: ddraw.h:276
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
#define ZeroMemory
Definition: winbase.h:1712

Referenced by GetD3D9DriverInfo().