Author: gbrunmar
Date: Sun Oct 5 02:33:05 2008
New Revision: 36651
URL:
http://svn.reactos.org/svn/reactos?rev=36651&view=rev
Log:
D3D9:
* Implemented DdGetAvailDriverMemory callback
Added:
trunk/reactos/dll/directx/d3d9/d3d9_callbacks.c (with props)
trunk/reactos/dll/directx/d3d9/d3d9_callbacks.h (with props)
Modified:
trunk/reactos/dll/directx/d3d9/d3d9.rbuild
trunk/reactos/dll/directx/d3d9/d3d9_caps.c
trunk/reactos/dll/directx/d3d9/d3d9_private.h
Modified: trunk/reactos/dll/directx/d3d9/d3d9.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9.rbui…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9.rbuild [iso-8859-1] Sun Oct 5 02:33:05 2008
@@ -14,6 +14,7 @@
<file>d3d9.c</file>
<file>d3d9_baseobject.c</file>
+ <file>d3d9_callbacks.c</file>
<file>d3d9_caps.c</file>
<file>d3d9_create.c</file>
<file>d3d9_cursor.c</file>
Added: trunk/reactos/dll/directx/d3d9/d3d9_callbacks.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_call…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_callbacks.c (added)
+++ trunk/reactos/dll/directx/d3d9/d3d9_callbacks.c [iso-8859-1] Sun Oct 5 02:33:05 2008
@@ -1,0 +1,51 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS ReactX
+ * FILE: dll/directx/d3d9/d3d9_callbacks.c
+ * PURPOSE: Direct3D9's callback functions
+ * PROGRAMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
+ */
+#include "d3d9_common.h"
+#include "d3d9_callbacks.h"
+#define STDCALL __stdcall
+#include <d3d9.h>
+#include <dll/directx/d3d8thk.h>
+#include "d3d9_private.h"
+#include "ddrawi.h"
+
+DWORD WINAPI D3d9GetAvailDriverMemory(LPD3D9_GETAVAILDRIVERMEMORYDATA pData)
+{
+ DWORD Ret = FALSE;
+ DDHAL_GETAVAILDRIVERMEMORYDATA Data;
+ ZeroMemory(&Data, sizeof(Data));
+
+ if (D3D9_GETAVAILDRIVERMEMORY_TYPE_ALL == pData->dwMemoryType)
+ {
+ Data.DDSCaps.dwCaps = DDSCAPS_VIDEOMEMORY;
+ }
+ else if (D3D9_GETAVAILDRIVERMEMORY_TYPE_LOCAL == pData->dwMemoryType)
+ {
+ Data.DDSCaps.dwCaps = DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM;
+ }
+ else if (D3D9_GETAVAILDRIVERMEMORY_TYPE_NONLOCAL == pData->dwMemoryType)
+ {
+ Data.DDSCaps.dwCaps = DDSCAPS_VIDEOMEMORY | DDSCAPS_NONLOCALVIDMEM;
+ }
+
+ if (Data.DDSCaps.dwCaps != 0)
+ {
+ if (0 == pData->dwTextureType)
+ Data.DDSCaps.dwCaps |= DDSCAPS_TEXTURE;
+
+ if (pData->dwTextureType & D3D9_TEXTURETYPE_HALSURFACE)
+ Data.DDSCaps.dwCaps |= DDSCAPS_TEXTURE | DDSCAPS_3DDEVICE;
+
+ if (pData->dwTextureType & D3D9_TEXTURETYPE_BACKBUFFER)
+ Data.DDSCaps.dwCaps |= DDSCAPS_ZBUFFER;
+
+ Ret = OsThunkDdGetAvailDriverMemory(pData->pUnknown6BC->hDirectDrawLocal,
(DD_GETAVAILDRIVERMEMORYDATA*)&Data);
+ pData->dwFree = Data.dwFree;
+ }
+
+ return Ret;
+}
Propchange: trunk/reactos/dll/directx/d3d9/d3d9_callbacks.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/directx/d3d9/d3d9_callbacks.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_call…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_callbacks.h (added)
+++ trunk/reactos/dll/directx/d3d9/d3d9_callbacks.h [iso-8859-1] Sun Oct 5 02:33:05 2008
@@ -1,0 +1,33 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS ReactX
+ * FILE: dll/directx/d3d9/d3d9_callbacks.h
+ * PURPOSE: Direct3D9's callback structs and constants
+ * PROGRAMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
+ */
+#ifndef _D3D9_CALLBACKS_H_
+#define _D3D9_CALLBACKS_H_
+
+typedef enum _D3D9_GETAVAILDRIVERMEMORY_TYPE
+{
+ D3D9_GETAVAILDRIVERMEMORY_TYPE_ALL = 0,
+ D3D9_GETAVAILDRIVERMEMORY_TYPE_LOCAL = 4,
+ D3D9_GETAVAILDRIVERMEMORY_TYPE_NONLOCAL = 5,
+} D3D9_GETAVAILDRIVERMEMORY_TYPE;
+
+#define D3D9_TEXTURETYPE_HALSURFACE 1
+#define D3D9_TEXTURETYPE_BACKBUFFER 2
+
+typedef struct _D3D9_GETAVAILDRIVERMEMORYDATA
+{
+/* 0x0000 */ struct _D3D9_Unknown6BC* pUnknown6BC;
+/* 0x0004 */ D3D9_GETAVAILDRIVERMEMORY_TYPE dwMemoryType;
+/* 0x0008 */ DWORD dwTextureType;
+/* 0x000c */ DWORD dwFree;
+} D3D9_GETAVAILDRIVERMEMORYDATA, FAR* LPD3D9_GETAVAILDRIVERMEMORYDATA;
+
+typedef DWORD (WINAPI FAR*
LPD3D9_GETAVAILDRIVERMEMORY)(LPD3D9_GETAVAILDRIVERMEMORYDATA);
+
+DWORD WINAPI D3d9GetAvailDriverMemory(LPD3D9_GETAVAILDRIVERMEMORYDATA pData);
+
+#endif // _D3D9_CALLBACKS_H_
Propchange: trunk/reactos/dll/directx/d3d9/d3d9_callbacks.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/directx/d3d9/d3d9_caps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_caps…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_caps.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_caps.c [iso-8859-1] Sun Oct 5 02:33:05 2008
@@ -11,6 +11,7 @@
#include "d3d9_helpers.h"
#include "d3d9_caps.h"
#include "adapter.h"
+#include "d3d9_callbacks.h"
static INT g_NumDevices = 0;
@@ -833,6 +834,7 @@
}
/* TODO: Set all internal function pointers to create surface, etc. */
+ pD3D9Callbacks->DdGetAvailDriverMemory = &D3d9GetAvailDriverMemory;
/* Set device rect */
{
Modified: trunk/reactos/dll/directx/d3d9/d3d9_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/d3d9/d3d9_priv…
==============================================================================
--- trunk/reactos/dll/directx/d3d9/d3d9_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/d3d9/d3d9_private.h [iso-8859-1] Sun Oct 5 02:33:05 2008
@@ -10,27 +10,12 @@
#include "d3d9_common.h"
#include <ddraw.h>
+#include "d3d9_callbacks.h"
#define D3D9_INT_MAX_NUM_ADAPTERS 12
#define D3D9_INT_D3DCAPS8_VALID 1
#define D3D9_INT_D3DCAPS9_VALID 2
-
-typedef enum _D3D9_GETAVAILDRIVERMEMORY_TYPE
-{
- D3D9_GETAVAILDRIVERMEMORY_TYPE_ALL = 0,
- D3D9_GETAVAILDRIVERMEMORY_TYPE_LOCAL = 4,
- D3D9_GETAVAILDRIVERMEMORY_TYPE_NONLOCAL = 5,
-} D3D9_GETAVAILDRIVERMEMORY_TYPE;
-
-typedef struct _D3D9_GETAVAILDRIVERMEMORYDATA
-{
-/* 0x0000 */ struct _D3D9_Unknown6BC* pUnknown6BC;
-/* 0x0004 */ D3D9_GETAVAILDRIVERMEMORY_TYPE dwMemoryType;
-/* 0x0008 */ DWORD dwTextureType;
-/* 0x000c */ DWORD dwFree;
-} D3D9_GETAVAILDRIVERMEMORYDATA, FAR* LPD3D9_GETAVAILDRIVERMEMORYDATA;
-typedef BOOL (WINAPI FAR* LPD3D9_GETAVAILDRIVERMEMORY)(LPD3D9_GETAVAILDRIVERMEMORYDATA);
typedef struct _D3D9_Unknown6BC
{