* Updated d3d headers to make it possible to include both d3d and d3d9 at the same...
authorGregor Brunmar <gbrunmar.ros@gmail.com>
Sun, 17 Feb 2008 13:34:59 +0000 (13:34 +0000)
committerGregor Brunmar <gbrunmar.ros@gmail.com>
Sun, 17 Feb 2008 13:34:59 +0000 (13:34 +0000)
* Updated d3dhal.h to support DirectX 9
* Fixed broken d3dnthal.h
* Fixed missing structures in d3d8thk.h

svn path=/trunk/; revision=32401

reactos/include/ddk/d3dhal.h
reactos/include/ddk/d3dnthal.h
reactos/include/ddk/ddrawi.h
reactos/include/ddk/ddrawint.h
reactos/include/psdk/d3d.h
reactos/include/psdk/d3d9types.h
reactos/include/psdk/d3dtypes.h
reactos/include/reactos/dll/directx/d3d8thk.h

index 325e186..2145783 100644 (file)
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
+#include <ddraw.h>
+#include <d3dtypes.h>
+#include <d3dcaps.h>
 #include <d3d.h>
 
 #include <d3d.h>
 
+#if (DIRECT3D_VERSION >= 0x0900)
+#include <d3d9.h>
+#endif
+
+#ifndef DDRAWI_DIRECTDRAW_DEFINED
+typedef struct _DDRAWI_DIRECTDRAW_GBL FAR *LPDDRAWI_DIRECTDRAW_GBL;
+typedef struct _DDRAWI_DIRECTDRAW_LCL FAR *LPDDRAWI_DIRECTDRAW_LCL;
+#define DDRAWI_DIRECTDRAW_DEFINED
+#endif
+
+#ifndef DDRAWI_DDRAWSURFACE_DEFINED
+typedef struct _DDRAWI_DDRAWSURFACE_LCL FAR *LPDDRAWI_DDRAWSURFACE_LCL;
+#define DDRAWI_DDRAWSURFACE_DEFINED
+#endif
+
 #define D3DERR_COMMAND_UNPARSED 0x88760BB8;
 
 /*****************************************************************************
 #define D3DERR_COMMAND_UNPARSED 0x88760BB8;
 
 /*****************************************************************************
@@ -579,6 +597,155 @@ typedef struct _D3DHAL_DP2SETTEXLOD {
   DWORD dwLOD;
 } D3DHAL_DP2SETTEXLOD,*LPD3DHAL_DP2SETTEXLOD;
 
   DWORD dwLOD;
 } D3DHAL_DP2SETTEXLOD,*LPD3DHAL_DP2SETTEXLOD;
 
+
+#if (DIRECT3D_VERSION >= 0x0900)
+
+#define DX9_DDI_VERSION     4
+
+#ifndef D3DVTXPCAPS_NO_VSDT_UBYTE4
+#define D3DVTXPCAPS_NO_VSDT_UBYTE4          0x00000080
+#endif
+
+#define D3DPMISCCAPS_LINEPATTERNREP         0x00000004
+
+#define D3DDEVCAPS_HWVERTEXBUFFER           0x02000000
+#define D3DDEVCAPS_HWINDEXBUFFER            0x04000000
+#define D3DDEVCAPS_SUBVOLUMELOCK            0x08000000
+
+#ifndef D3DPMISCCAPS_FOGINFVF
+#define D3DPMISCCAPS_FOGINFVF               0x00002000
+#endif
+
+#ifndef D3DFVF_FOG
+#define D3DFVF_FOG                          0x00002000
+#endif
+
+typedef struct _DD_GETDRIVERINFO2DATA
+{
+    DWORD       dwReserved;
+    DWORD       dwMagic;
+    DWORD       dwType;
+    DWORD       dwExpectedSize;
+} DD_GETDRIVERINFO2DATA;
+
+/**
+ * A driver must check DD_GETDRIVERINFO2DATA.dwHeight for
+ * D3DGDI2_MAGIC to see if the passed GUID is GUID_GetDriverInfo2
+ * or a GUID_DDStereoMode.
+ */
+#define GUID_GetDriverInfo2                         GUID_DDStereoMode
+
+/**
+ * Magic number used in DD_GETDRIVERINFO2DATA.dwHeight when
+ * GUID_GetDriverInfo2/GUID_DDStereoMode is specified in a
+ * GetDriverInfo call.
+ */
+#define D3DGDI2_MAGIC                               0xFFFFFFFF
+
+#define D3DGDI2_TYPE_GETD3DCAPS8                    0x00000001
+#define D3DGDI2_TYPE_GETFORMATCOUNT                 0x00000002
+#define D3DGDI2_TYPE_GETFORMAT                      0x00000003
+#define D3DGDI2_TYPE_DXVERSION                      0x00000004  /* Make driver aware of currently used DirectX version */
+#define D3DGDI2_TYPE_GETD3DCAPS9                    0x00000010
+#define D3DGDI2_TYPE_GETEXTENDEDMODECOUNT           0x00000011
+#define D3DGDI2_TYPE_GETEXTENDEDMODE                0x00000012
+#define D3DGDI2_TYPE_GETADAPTERGROUP                0x00000013
+#define D3DGDI2_TYPE_GETMULTISAMPLEQUALITYLEVELS    0x00000016
+#define D3DGDI2_TYPE_DEFERRED_AGP_AWARE             0x00000018
+#define D3DGDI2_TYPE_FREE_DEFERRED_AGP              0x00000019
+#define D3DGDI2_TYPE_DEFER_AGP_FREES                0x00000020
+#define D3DGDI2_TYPE_GETD3DQUERYCOUNT               0x00000021
+#define D3DGDI2_TYPE_GETD3DQUERY                    0x00000022
+#define D3DGDI2_TYPE_GETDDIVERSION                  0x00000023  /* Returns DX9_DDI_VERSION, used to check which DDK version the driver is compiled against */
+
+typedef struct _DD_GETFORMATCOUNTDATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    DWORD dwFormatCount;
+    DWORD dwReserved;
+} DD_GETFORMATCOUNTDATA;
+
+typedef struct _DD_GETFORMATDATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    DWORD dwFormatIndex;
+    DDPIXELFORMAT format;
+} DD_GETFORMATDATA;
+
+typedef struct _DD_DXVERSION
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    DWORD dwDXVersion;
+    DWORD dwReserved;
+} DD_DXVERSION;
+
+typedef struct _DD_DEFERRED_AGP_AWARE_DATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+} DD_DEFERRED_AGP_AWARE_DATA;
+
+typedef struct _DD_FREE_DEFERRED_AGP_DATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    DWORD dwProcessId;
+} DD_FREE_DEFERRED_AGP_DATA;
+
+typedef struct _DD_GETEXTENDEDMODECOUNTDATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    DWORD dwModeCount;
+    DWORD dwReserved;
+} DD_GETEXTENDEDMODECOUNTDATA;
+
+typedef struct _DD_GETEXTENDEDMODEDATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    DWORD                 dwModeIndex;
+    D3DDISPLAYMODE        mode;
+} DD_GETEXTENDEDMODEDATA;
+
+typedef struct _DD_GETADAPTERGROUPDATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    ULONG_PTR ulUniqueAdapterGroupId;
+    DWORD dwReserved1;
+    DWORD dwReserved2;
+} DD_GETADAPTERGROUPDATA;
+
+typedef struct _DD_MULTISAMPLEQUALITYLEVELSDATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    D3DFORMAT Format;
+    BOOL                    bFlip  :  1;
+    D3DMULTISAMPLE_TYPE     MSType : 31;
+    DWORD QualityLevels;
+} DD_MULTISAMPLEQUALITYLEVELSDATA;
+
+typedef struct _DD_GETD3DQUERYCOUNTDATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    DWORD dwNumQueries;
+} DD_GETD3DQUERYCOUNTDATA;
+
+typedef struct _DD_GETD3DQUERYDATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    union
+    {
+        DWORD dwQueryIndex;
+        D3DQUERYTYPE QueryType;
+    };
+} DD_GETD3DQUERYDATA;
+
+typedef struct _DD_GETDDIVERSIONDATA
+{
+    DD_GETDRIVERINFO2DATA gdi2;
+    DWORD dwDXVersion;
+    DWORD dwDDIVersion;
+} DD_GETDDIVERSIONDATA;
+
+#endif /* (DIRECT3D_VERSION >= 0x0900) */
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
index 39142c4..b7bb06e 100644 (file)
@@ -167,8 +167,19 @@ typedef struct _D3DNTHAL_CALLBACKS
     ULONG_PTR dwReserved9;
 } D3DNTHAL_CALLBACKS, *LPD3DNTHAL_CALLBACKS;
 
     ULONG_PTR dwReserved9;
 } D3DNTHAL_CALLBACKS, *LPD3DNTHAL_CALLBACKS;
 
+
+typedef struct _D3DNTHAL_SETRENDERTARGETDATA
+{
+    ULONG_PTR dwhContext;
+    PDD_SURFACE_LOCAL lpDDS;
+    PDD_SURFACE_LOCAL lpDDSZ;
+    HRESULT ddrval;
+} D3DNTHAL_SETRENDERTARGETDATA;
+typedef D3DNTHAL_SETRENDERTARGETDATA *LPD3DNTHAL_SETRENDERTARGETDATA;
+
 typedef DWORD (APIENTRY *LPD3DNTHAL_SETRENDERTARGETCB)(LPD3DNTHAL_SETRENDERTARGETDATA);
 
 typedef DWORD (APIENTRY *LPD3DNTHAL_SETRENDERTARGETCB)(LPD3DNTHAL_SETRENDERTARGETDATA);
 
+
 typedef struct _D3DNTHAL_CALLBACKS2
 {
     DWORD dwSize;
 typedef struct _D3DNTHAL_CALLBACKS2
 {
     DWORD dwSize;
@@ -181,21 +192,19 @@ typedef struct _D3DNTHAL_CALLBACKS2
     LPVOID dwReserved4;
 } D3DNTHAL_CALLBACKS2, *LPD3DNTHAL_CALLBACKS2;
 
     LPVOID dwReserved4;
 } D3DNTHAL_CALLBACKS2, *LPD3DNTHAL_CALLBACKS2;
 
-typedef DWORD (APIENTRY *LPD3DNTHAL_CLEAR2CB)(LPD3DNTHAL_CLEAR2DATA);
-typedef DWORD (APIENTRY *LPD3DNTHAL_VALIDATETEXTURESTAGESTATECB)(LPD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA);
-typedef DWORD (APIENTRY *LPD3DNTHAL_DRAWPRIMITIVES2CB)(LPD3DNTHAL_DRAWPRIMITIVES2DATA);
 
 
-typedef struct _D3DNTHAL_CALLBACKS3
+typedef struct _D3DNTHAL_CLEAR2DATA
 {
 {
-    DWORD dwSize; 
+    ULONG_PTR dwhContext;
     DWORD dwFlags;
     DWORD dwFlags;
-
-    LPD3DNTHAL_CLEAR2CB Clear2;
-    LPVOID lpvReserved;
-    LPD3DNTHAL_VALIDATETEXTURESTAGESTATECB ValidateTextureStageState;
-    LPD3DNTHAL_DRAWPRIMITIVES2CB DrawPrimitives2;
-} D3DNTHAL_CALLBACKS3, *LPD3DNTHAL_CALLBACKS3;
-
+    DWORD dwFillColor;
+    D3DVALUE dvFillDepth;
+    DWORD dwFillStencil;
+    LPD3DRECT lpRects;
+    DWORD dwNumRects;
+    HRESULT ddrval;
+} D3DNTHAL_CLEAR2DATA;
+typedef D3DNTHAL_CLEAR2DATA FAR *LPD3DNTHAL_CLEAR2DATA;
 
 typedef struct _D3DNTHAL_VALIDATETEXTURESTAGESTATEDATA
 {
 
 typedef struct _D3DNTHAL_VALIDATETEXTURESTAGESTATEDATA
 {
@@ -232,6 +241,21 @@ typedef struct _D3DNTHAL_DRAWPRIMITIVES2DATA
     DWORD dwErrorOffset;
 } D3DNTHAL_DRAWPRIMITIVES2DATA, FAR *LPD3DNTHAL_DRAWPRIMITIVES2DATA;
 
     DWORD dwErrorOffset;
 } D3DNTHAL_DRAWPRIMITIVES2DATA, FAR *LPD3DNTHAL_DRAWPRIMITIVES2DATA;
 
+typedef DWORD (APIENTRY *LPD3DNTHAL_CLEAR2CB)(LPD3DNTHAL_CLEAR2DATA);
+typedef DWORD (APIENTRY *LPD3DNTHAL_VALIDATETEXTURESTAGESTATECB)(LPD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA);
+typedef DWORD (APIENTRY *LPD3DNTHAL_DRAWPRIMITIVES2CB)(LPD3DNTHAL_DRAWPRIMITIVES2DATA);
+
+typedef struct _D3DNTHAL_CALLBACKS3
+{
+    DWORD dwSize; 
+    DWORD dwFlags;
+
+    LPD3DNTHAL_CLEAR2CB Clear2;
+    LPVOID lpvReserved;
+    LPD3DNTHAL_VALIDATETEXTURESTAGESTATECB ValidateTextureStageState;
+    LPD3DNTHAL_DRAWPRIMITIVES2CB DrawPrimitives2;
+} D3DNTHAL_CALLBACKS3, *LPD3DNTHAL_CALLBACKS3;
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
index ab8f565..66c569e 100644 (file)
@@ -129,10 +129,20 @@ typedef DWORD (PASCAL *LPDD32BITDRIVERINIT)(DWORD dwContext);
 /* predeclare some structures */
 typedef struct _DDHALINFO *LPDDHALINFO;
 typedef struct _DDRAWI_DIRECTDRAW_INT *LPDDRAWI_DIRECTDRAW_INT;
 /* predeclare some structures */
 typedef struct _DDHALINFO *LPDDHALINFO;
 typedef struct _DDRAWI_DIRECTDRAW_INT *LPDDRAWI_DIRECTDRAW_INT;
+
+#ifndef DDRAWI_DIRECTDRAW_DEFINED
 typedef struct _DDRAWI_DIRECTDRAW_LCL *LPDDRAWI_DIRECTDRAW_LCL;
 typedef struct _DDRAWI_DIRECTDRAW_GBL *LPDDRAWI_DIRECTDRAW_GBL;
 typedef struct _DDRAWI_DIRECTDRAW_LCL *LPDDRAWI_DIRECTDRAW_LCL;
 typedef struct _DDRAWI_DIRECTDRAW_GBL *LPDDRAWI_DIRECTDRAW_GBL;
+#define DDRAWI_DIRECTDRAW_DEFINED
+#endif
+
 typedef struct _DDRAWI_DDRAWSURFACE_INT *LPDDRAWI_DDRAWSURFACE_INT;
 typedef struct _DDRAWI_DDRAWSURFACE_INT *LPDDRAWI_DDRAWSURFACE_INT;
+
+#ifndef DDRAWI_DDRAWSURFACE_DEFINED
 typedef struct _DDRAWI_DDRAWSURFACE_LCL *LPDDRAWI_DDRAWSURFACE_LCL;
 typedef struct _DDRAWI_DDRAWSURFACE_LCL *LPDDRAWI_DDRAWSURFACE_LCL;
+#define DDRAWI_DDRAWSURFACE_DEFINED
+#endif
+
 typedef struct _DDRAWI_DDRAWSURFACE_GBL *LPDDRAWI_DDRAWSURFACE_GBL;
 typedef struct _DDRAWI_DDRAWSURFACE_MORE *LPDDRAWI_DDRAWSURFACE_MORE;
 typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE *LPDDRAWI_DDRAWSURFACE_GBL_MORE;
 typedef struct _DDRAWI_DDRAWSURFACE_GBL *LPDDRAWI_DDRAWSURFACE_GBL;
 typedef struct _DDRAWI_DDRAWSURFACE_MORE *LPDDRAWI_DDRAWSURFACE_MORE;
 typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE *LPDDRAWI_DDRAWSURFACE_GBL_MORE;
index 0d6a867..c2a5ff4 100644 (file)
@@ -1451,15 +1451,6 @@ typedef struct DD_KERNELCALLBACKS
 #define DDRAWI_VPORTGETCOLOR                  0x0001
 #define DDRAWI_VPORTSETCOLOR                  0x0002
 
 #define DDRAWI_VPORTGETCOLOR                  0x0001
 #define DDRAWI_VPORTSETCOLOR                  0x0002
 
-#ifndef __DDRAWI_INCLUDED__
-#define VIDMEM_ISLINEAR                0x00000001
-#define VIDMEM_ISRECTANGULAR   0x00000002
-#define VIDMEM_ISHEAP          0x00000004
-#define VIDMEM_ISNONLOCAL      0x00000008
-#define VIDMEM_ISWC            0x00000010
-#define VIDMEM_ISDISABLED      0x00000020
-#endif
-
 
 #ifdef __cplusplus
 } /* extern "C" */
 
 #ifdef __cplusplus
 } /* extern "C" */
index 6a6482d..17f5dc1 100644 (file)
 #ifndef __WINE_D3D_H
 #define __WINE_D3D_H
 
 #ifndef __WINE_D3D_H
 #define __WINE_D3D_H
 
+#ifndef DIRECT3D_VERSION
+#define DIRECT3D_VERSION         0x0700
+#endif
+
+#if (DIRECT3D_VERSION < 0x0800)
+
 #include <stdlib.h>
 
 #define COM_NO_WINDOWS_H
 #include <stdlib.h>
 
 #define COM_NO_WINDOWS_H
@@ -1528,4 +1534,5 @@ DECLARE_INTERFACE_(IDirect3DVertexBuffer7,IUnknown)
 #define IDirect3DVertexBuffer7_ProcessVerticesStrided(p,a,b,c,d,e,f,g) (p)->ProcessVerticesStrided(a,b,c,d,e,f,g)
 #endif
 
 #define IDirect3DVertexBuffer7_ProcessVerticesStrided(p,a,b,c,d,e,f,g) (p)->ProcessVerticesStrided(a,b,c,d,e,f,g)
 #endif
 
+#endif /* (DIRECT3D_VERSION < 0x0800) */
 #endif /* __WINE_D3D_H */
 #endif /* __WINE_D3D_H */
index cf46cb7..638fa02 100644 (file)
@@ -875,7 +875,7 @@ typedef enum _D3DMULTISAMPLE_TYPE {
     D3DMULTISAMPLE_15_SAMPLES      = 15,
     D3DMULTISAMPLE_16_SAMPLES      = 16,
 
     D3DMULTISAMPLE_15_SAMPLES      = 15,
     D3DMULTISAMPLE_16_SAMPLES      = 16,
 
-    D3DMULTISAMPLE_FORCE_DWORD     = 0xffffffff
+    D3DMULTISAMPLE_FORCE_DWORD     = 0x7fffffff
 } D3DMULTISAMPLE_TYPE;
 
 #if 0
 } D3DMULTISAMPLE_TYPE;
 
 #if 0
index 8cc1d24..dc36d4f 100644 (file)
@@ -147,6 +147,7 @@ typedef DWORD D3DMATERIALHANDLE, *LPD3DMATERIALHANDLE;
 typedef DWORD D3DTEXTUREHANDLE,  *LPD3DTEXTUREHANDLE;
 typedef DWORD D3DMATRIXHANDLE,   *LPD3DMATRIXHANDLE;
 
 typedef DWORD D3DTEXTUREHANDLE,  *LPD3DTEXTUREHANDLE;
 typedef DWORD D3DMATRIXHANDLE,   *LPD3DMATRIXHANDLE;
 
+#ifndef D3DCOLORVALUE_DEFINED
 typedef struct _D3DCOLORVALUE {
         union {
                 D3DVALUE r;
 typedef struct _D3DCOLORVALUE {
         union {
                 D3DVALUE r;
@@ -165,7 +166,9 @@ typedef struct _D3DCOLORVALUE {
                 D3DVALUE dvA;
         } DUMMYUNIONNAME4;
 } D3DCOLORVALUE,*LPD3DCOLORVALUE;
                 D3DVALUE dvA;
         } DUMMYUNIONNAME4;
 } D3DCOLORVALUE,*LPD3DCOLORVALUE;
+#endif
 
 
+#ifndef D3DRECT_DEFINED
 typedef struct _D3DRECT {
   union {
     LONG x1;
 typedef struct _D3DRECT {
   union {
     LONG x1;
@@ -183,7 +186,9 @@ typedef struct _D3DRECT {
     LONG y2;
     LONG lY2;
   } DUMMYUNIONNAME4;
     LONG y2;
     LONG lY2;
   } DUMMYUNIONNAME4;
-} D3DRECT, *LPD3DRECT;
+} D3DRECT;
+#endif
+typedef struct _D3DRECT *LPD3DRECT;
 
 typedef struct _D3DHVERTEX {
     DWORD         dwFlags;
 
 typedef struct _D3DHVERTEX {
     DWORD         dwFlags;
@@ -324,6 +329,7 @@ public:
 #endif
 } D3DVERTEX, *LPD3DVERTEX;
 
 #endif
 } D3DVERTEX, *LPD3DVERTEX;
 
+#ifndef D3DMATRIX_DEFINED
 typedef struct _D3DMATRIX {
   D3DVALUE        _11, _12, _13, _14;
   D3DVALUE        _21, _22, _23, _24;
 typedef struct _D3DMATRIX {
   D3DVALUE        _11, _12, _13, _14;
   D3DVALUE        _21, _22, _23, _24;
@@ -339,6 +345,7 @@ typedef struct _D3DMATRIX {
        { return ((const D3DVALUE [4][4])&_11)[r][c]; }
 #endif
 } D3DMATRIX, *LPD3DMATRIX;
        { return ((const D3DVALUE [4][4])&_11)[r][c]; }
 #endif
 } D3DMATRIX, *LPD3DMATRIX;
+#endif
 
 #if defined(__cplusplus) && defined(D3D_OVERLOADS)
 #include <d3dvec.inl>
 
 #if defined(__cplusplus) && defined(D3D_OVERLOADS)
 #include <d3dvec.inl>
@@ -534,6 +541,8 @@ typedef struct _D3DMATERIAL7 {
   } DUMMYUNIONNAME4;
 } D3DMATERIAL7, *LPD3DMATERIAL7;
 
   } DUMMYUNIONNAME4;
 } D3DMATERIAL7, *LPD3DMATERIAL7;
 
+#if (DIRECT3D_VERSION < 0x0800)
+
 typedef enum {
   D3DLIGHT_POINT          = 1,
   D3DLIGHT_SPOT           = 2,
 typedef enum {
   D3DLIGHT_POINT          = 1,
   D3DLIGHT_SPOT           = 2,
@@ -543,6 +552,8 @@ typedef enum {
   D3DLIGHT_FORCE_DWORD    = 0x7fffffff
 } D3DLIGHTTYPE;
 
   D3DLIGHT_FORCE_DWORD    = 0x7fffffff
 } D3DLIGHTTYPE;
 
+#endif
+
 typedef struct _D3DLIGHT {
     DWORD           dwSize;
     D3DLIGHTTYPE    dltType;
 typedef struct _D3DLIGHT {
     DWORD           dwSize;
     D3DLIGHTTYPE    dltType;
@@ -609,10 +620,17 @@ typedef struct _D3DLIGHTDATA {
 
 typedef DWORD D3DCOLORMODEL;
 
 
 typedef DWORD D3DCOLORMODEL;
 
-
+#ifndef D3DCLEAR_TARGET
 #define D3DCLEAR_TARGET   0x00000001
 #define D3DCLEAR_TARGET   0x00000001
+#endif
+
+#ifndef D3DCLEAR_ZBUFFER
 #define D3DCLEAR_ZBUFFER  0x00000002
 #define D3DCLEAR_ZBUFFER  0x00000002
+#endif
+
+#ifndef D3DCLEAR_STENCIL
 #define D3DCLEAR_STENCIL  0x00000004
 #define D3DCLEAR_STENCIL  0x00000004
+#endif
 
 typedef enum _D3DOPCODE {
   D3DOP_POINT           = 1,
 
 typedef enum _D3DOPCODE {
   D3DOP_POINT           = 1,
@@ -651,6 +669,8 @@ typedef struct _D3DPICKRECORD {
   D3DVALUE dvZ;
 } D3DPICKRECORD, *LPD3DPICKRECORD;
 
   D3DVALUE dvZ;
 } D3DPICKRECORD, *LPD3DPICKRECORD;
 
+#if (DIRECT3D_VERSION < 0x0800)
+
 typedef enum {
   D3DSHADE_FLAT         = 1,
   D3DSHADE_GOURAUD      = 2,
 typedef enum {
   D3DSHADE_FLAT         = 1,
   D3DSHADE_GOURAUD      = 2,
@@ -670,6 +690,8 @@ typedef struct _D3DLINEPATTERN {
   WORD    wLinePattern;
 } D3DLINEPATTERN;
 
   WORD    wLinePattern;
 } D3DLINEPATTERN;
 
+#endif /* (DIRECT3D_VERSION < 0x0800) */
+
 typedef enum {
   D3DFILTER_NEAREST          = 1,
   D3DFILTER_LINEAR           = 2,
 typedef enum {
   D3DFILTER_NEAREST          = 1,
   D3DFILTER_LINEAR           = 2,
@@ -680,6 +702,8 @@ typedef enum {
   D3DFILTER_FORCE_DWORD      = 0x7fffffff
 } D3DTEXTUREFILTER;
 
   D3DFILTER_FORCE_DWORD      = 0x7fffffff
 } D3DTEXTUREFILTER;
 
+#if (DIRECT3D_VERSION < 0x0800)
+
 typedef enum {
   D3DBLEND_ZERO            = 1,
   D3DBLEND_ONE             = 2,
 typedef enum {
   D3DBLEND_ZERO            = 1,
   D3DBLEND_ONE             = 2,
@@ -697,6 +721,9 @@ typedef enum {
   D3DBLEND_FORCE_DWORD     = 0x7fffffff
 } D3DBLEND;
 
   D3DBLEND_FORCE_DWORD     = 0x7fffffff
 } D3DBLEND;
 
+#endif /* (DIRECT3D_VERSION < 0x0800) */
+
+
 typedef enum {
   D3DTBLEND_DECAL         = 1,
   D3DTBLEND_MODULATE      = 2,
 typedef enum {
   D3DTBLEND_DECAL         = 1,
   D3DTBLEND_MODULATE      = 2,
@@ -709,6 +736,9 @@ typedef enum {
   D3DTBLEND_FORCE_DWORD   = 0x7fffffff
 } D3DTEXTUREBLEND;
 
   D3DTBLEND_FORCE_DWORD   = 0x7fffffff
 } D3DTEXTUREBLEND;
 
+
+#if (DIRECT3D_VERSION < 0x0800)
+
 typedef enum _D3DTEXTUREADDRESS {
     D3DTADDRESS_WRAP           = 1,
     D3DTADDRESS_MIRROR         = 2,
 typedef enum _D3DTEXTUREADDRESS {
     D3DTADDRESS_WRAP           = 1,
     D3DTADDRESS_MIRROR         = 2,
@@ -763,6 +793,8 @@ typedef enum _D3DZBUFFERTYPE {
   D3DZB_FORCE_DWORD  = 0x7fffffff
 } D3DZBUFFERTYPE;
 
   D3DZB_FORCE_DWORD  = 0x7fffffff
 } D3DZBUFFERTYPE;
 
+#endif /* (DIRECT3D_VERSION < 0x0800) */
+
 typedef enum _D3DANTIALIASMODE {
   D3DANTIALIAS_NONE            = 0,
   D3DANTIALIAS_SORTDEPENDENT   = 1,
 typedef enum _D3DANTIALIASMODE {
   D3DANTIALIAS_NONE            = 0,
   D3DANTIALIAS_SORTDEPENDENT   = 1,
@@ -777,6 +809,8 @@ typedef enum {
   D3DVT_FORCE_DWORD   = 0x7fffffff
 } D3DVERTEXTYPE;
 
   D3DVT_FORCE_DWORD   = 0x7fffffff
 } D3DVERTEXTYPE;
 
+#if (DIRECT3D_VERSION < 0x0800)
+
 typedef enum {
   D3DPT_POINTLIST     = 1,
   D3DPT_LINELIST      = 2,
 typedef enum {
   D3DPT_POINTLIST     = 1,
   D3DPT_LINELIST      = 2,
@@ -787,10 +821,14 @@ typedef enum {
   D3DPT_FORCE_DWORD   = 0x7fffffff
 } D3DPRIMITIVETYPE;
 
   D3DPT_FORCE_DWORD   = 0x7fffffff
 } D3DPRIMITIVETYPE;
 
+#endif /* (DIRECT3D_VERSION < 0x0800) */
+
 #define D3DSTATE_OVERRIDE_BIAS      256
 
 #define D3DSTATE_OVERRIDE(type) (D3DRENDERSTATETYPE)(((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS))
 
 #define D3DSTATE_OVERRIDE_BIAS      256
 
 #define D3DSTATE_OVERRIDE(type) (D3DRENDERSTATETYPE)(((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS))
 
+#if (DIRECT3D_VERSION < 0x0800)
+
 typedef enum _D3DTRANSFORMSTATETYPE {
     D3DTRANSFORMSTATE_WORLD         = 1,
     D3DTRANSFORMSTATE_VIEW          = 2,
 typedef enum _D3DTRANSFORMSTATETYPE {
     D3DTRANSFORMSTATE_WORLD         = 1,
     D3DTRANSFORMSTATE_VIEW          = 2,
@@ -809,6 +847,8 @@ typedef enum _D3DTRANSFORMSTATETYPE {
     D3DTRANSFORMSTATE_FORCE_DWORD   = 0x7fffffff
 } D3DTRANSFORMSTATETYPE;
 
     D3DTRANSFORMSTATE_FORCE_DWORD   = 0x7fffffff
 } D3DTRANSFORMSTATETYPE;
 
+#endif /* (DIRECT3D_VERSION < 0x0800) */
+
 typedef enum {
   D3DLIGHTSTATE_MATERIAL      = 1,
   D3DLIGHTSTATE_AMBIENT       = 2,
 typedef enum {
   D3DLIGHTSTATE_MATERIAL      = 1,
   D3DLIGHTSTATE_AMBIENT       = 2,
@@ -821,6 +861,8 @@ typedef enum {
   D3DLIGHTSTATE_FORCE_DWORD   = 0x7fffffff
 } D3DLIGHTSTATETYPE;
 
   D3DLIGHTSTATE_FORCE_DWORD   = 0x7fffffff
 } D3DLIGHTSTATETYPE;
 
+#if (DIRECT3D_VERSION < 0x0800)
+
 typedef enum {
   D3DRENDERSTATE_TEXTUREHANDLE      = 1,
   D3DRENDERSTATE_ANTIALIAS          = 2,
 typedef enum {
   D3DRENDERSTATE_TEXTUREHANDLE      = 1,
   D3DRENDERSTATE_ANTIALIAS          = 2,
@@ -966,6 +1008,8 @@ typedef enum _D3DMATERIALCOLORSOURCE
 #define D3DWRAPCOORD_2   0x00000004L
 #define D3DWRAPCOORD_3   0x00000008L
 
 #define D3DWRAPCOORD_2   0x00000004L
 #define D3DWRAPCOORD_3   0x00000008L
 
+#endif /* (DIRECT3D_VERSION < 0x0800) */
+
 #define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
 
 typedef struct _D3DSTATE {
 #define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
 
 typedef struct _D3DSTATE {
@@ -1007,6 +1051,8 @@ typedef struct _D3DPROCESSVERTICES {
 #define D3DPROCESSVERTICES_UPDATEEXTENTS        0x00000008L
 #define D3DPROCESSVERTICES_NOCOLOR              0x00000010L
 
 #define D3DPROCESSVERTICES_UPDATEEXTENTS        0x00000008L
 #define D3DPROCESSVERTICES_NOCOLOR              0x00000010L
 
+#if (DIRECT3D_VERSION < 0x0800)
+
 typedef enum _D3DTEXTURESTAGESTATETYPE
 {
     D3DTSS_COLOROP        =  1,
 typedef enum _D3DTEXTURESTAGESTATETYPE
 {
     D3DTSS_COLOROP        =  1,
@@ -1085,6 +1131,8 @@ typedef enum _D3DTEXTUREOP
 #define D3DTA_COMPLEMENT        0x00000010
 #define D3DTA_ALPHAREPLICATE    0x00000020
 
 #define D3DTA_COMPLEMENT        0x00000010
 #define D3DTA_ALPHAREPLICATE    0x00000020
 
+#endif /* (DIRECT3D_VERSION < 0x0800) */
+
 typedef enum _D3DTEXTUREMAGFILTER
 {
     D3DTFG_POINT        = 1,
 typedef enum _D3DTEXTUREMAGFILTER
 {
     D3DTFG_POINT        = 1,
@@ -1231,6 +1279,8 @@ typedef struct _D3DVERTEXBUFFERDESC {
 #define D3DVOP_CLIP        (1 << 2)
 #define D3DVOP_EXTENTS     (1 << 3)
 
 #define D3DVOP_CLIP        (1 << 2)
 #define D3DVOP_EXTENTS     (1 << 3)
 
+#if (DIRECT3D_VERSION < 0x0800)
+
 #define D3DMAXNUMVERTICES    ((1<<16) - 1)
 
 #define D3DMAXNUMPRIMITIVES  ((1<<16) - 1)
 #define D3DMAXNUMVERTICES    ((1<<16) - 1)
 
 #define D3DMAXNUMPRIMITIVES  ((1<<16) - 1)
@@ -1265,6 +1315,8 @@ typedef struct _D3DVERTEXBUFFERDESC {
 
 #define D3DFVF_RESERVED2        0xf000
 
 
 #define D3DFVF_RESERVED2        0xf000
 
+#endif /* (DIRECT3D_VERSION < 0x0800) */
+
 #define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )
 #define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \
                          D3DFVF_SPECULAR | D3DFVF_TEX1 )
 #define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )
 #define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \
                          D3DFVF_SPECULAR | D3DFVF_TEX1 )
@@ -1316,6 +1368,9 @@ typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA  {
 #define D3DVIS_MASK_NEAR            (3 << 10)
 #define D3DVIS_MASK_FAR             (3 << 12)
 
 #define D3DVIS_MASK_NEAR            (3 << 10)
 #define D3DVIS_MASK_FAR             (3 << 12)
 
+
+#if (DIRECT3D_VERSION < 0x0800)
+
 #define D3DDEVINFOID_TEXTUREMANAGER    1
 #define D3DDEVINFOID_D3DTEXTUREMANAGER 2
 #define D3DDEVINFOID_TEXTURING         3
 #define D3DDEVINFOID_TEXTUREMANAGER    1
 #define D3DDEVINFOID_D3DTEXTUREMANAGER 2
 #define D3DDEVINFOID_TEXTURING         3
@@ -1356,4 +1411,6 @@ typedef enum _D3DTEXTURETRANSFORMFLAGS {
 #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
 #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
 
 #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
 #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))
 
+#endif /* (DIRECT3D_VERSION < 0x0800) */
+
 #endif
 #endif
index ee6a566..8a5202d 100644 (file)
@@ -9,40 +9,26 @@
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
-/* FIXME missing PD3DNTHAL_CONTEXTCREATEDATA
 BOOL STDCALL OsThunkD3dContextCreate(
     HANDLE hDirectDrawLocal,
     HANDLE hSurfColor,
     HANDLE hSurfZ,
 BOOL STDCALL OsThunkD3dContextCreate(
     HANDLE hDirectDrawLocal,
     HANDLE hSurfColor,
     HANDLE hSurfZ,
-    PD3DNTHAL_CONTEXTCREATEDATA pdcci
+    LPD3DNTHAL_CONTEXTDESTROYDATA pdcci
 );
 
 
 DWORD STDCALL OsThunkD3dContextDestroy(
 );
 
 
 DWORD STDCALL OsThunkD3dContextDestroy(
-    PD3DNTHAL_CONTEXTDESTROYDATA pContextDestroyData
+    LPD3DNTHAL_CONTEXTDESTROYDATA pContextDestroyData
 );
 
 );
 
-DWORD STDCALL
-    OsThunkD3dContextDestroyAll(PD3DNTHAL_CONTEXTDESTROYDATA pContextDestroyData);
-*/
-
-DWORD STDCALL OsThunkD3dContextDestroyAll(LPVOID);
-
-/* FIXME PD3DNTHAL_DRAWPRIMITIVES2DATA, PD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA missing
-DWORD STDCALL OsThunkD3dDrawPrimitives2(
-    HANDLE hCmdBuf,
-    HANDLE hVBuf,
-    PD3DNTHAL_DRAWPRIMITIVES2DATA pded,
-    FLATPTR *pfpVidMemCmd,
-    DWORD *pdwSizeCmd,
-    FLATPTR *pfpVidMemVtx,
-    DWORD *pdwSizeVtx
+DWORD STDCALL OsThunkD3dContextDestroyAll(
+    LPD3DNTHAL_CONTEXTDESTROYDATA pContextDestroyData
 );
 
 DWORD STDCALL OsThunkD3dValidateTextureStageState(
 );
 
 DWORD STDCALL OsThunkD3dValidateTextureStageState(
-    PD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA pData
+    LPD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA pData
 );
 );
-*/
+
 
 DWORD STDCALL OsThunkDdAddAttachedSurface(
     HANDLE hSurface,
 
 DWORD STDCALL OsThunkDdAddAttachedSurface(
     HANDLE hSurface,