[HEADERS]
[reactos.git] / reactos / include / ddk / d3dhal.h
index d60fda2..d4ecc2c 100644 (file)
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef __WINE_D3DHAL_H
-#define __WINE_D3DHAL_H
+#ifndef _D3DHAL_H_
+#define _D3DHAL_H_
+
+/* Helper macro to enable gcc's extension.  */
+#ifndef __GNU_EXTENSION
+#ifdef __GNUC__
+#define __GNU_EXTENSION __extension__
+#else
+#define __GNU_EXTENSION
+#endif
+#endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <ddrawi.h>
+#include <ddraw.h>
+#include <d3dtypes.h>
+#include <d3dcaps.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;
+
 /*****************************************************************************
  * device info structures
  */
@@ -58,7 +86,12 @@ typedef struct _D3DHAL_GLOBALDRIVERDATA {
   DWORD                        dwNumClipVertices;
   DWORD                        dwNumTextureFormats;
   LPDDSURFACEDESC      lpTextureFormats;
-} D3DHAL_GLOBALDRIVERDATA,*LPD3DHAL_GLOBALDRIVERDATA;
+} D3DHAL_GLOBALDRIVERDATA;
+
+#ifndef D3DHAL_GLOBALDRIVERDATA_DEFINED
+typedef D3DHAL_GLOBALDRIVERDATA *LPD3DHAL_GLOBALDRIVERDATA;
+#define D3DHAL_GLOBALDRIVERDATA_DEFINED
+#endif
 
 typedef struct _D3DHAL_D3DEXTENDEDCAPS {
   DWORD                        dwSize;
@@ -158,7 +191,12 @@ typedef struct _D3DHAL_CALLBACKS {
   DWORD                                dwReserved7;
   DWORD                                dwReserved8;
   DWORD                                dwReserved9;
-} D3DHAL_CALLBACKS,*LPD3DHAL_CALLBACKS;
+} D3DHAL_CALLBACKS;
+
+#ifndef D3DHAL_CALLBACKS_DEFINED
+typedef D3DHAL_CALLBACKS *LPD3DHAL_CALLBACKS;
+#define D3DHAL_CALLBACKS_DEFINED
+#endif
 
 typedef struct _D3DHAL_SETRENDERTARGETDATA             *LPD3DHAL_SETRENDERTARGETDATA;
 typedef struct _D3DHAL_CLEARDATA                       *LPD3DHAL_CLEARDATA;
@@ -303,7 +341,6 @@ typedef enum _D3DHAL_DP2OPERATION {
   D3DDP2OP_POINTS              = 1,
   D3DDP2OP_INDEXEDLINELIST     = 2,
   D3DDP2OP_INDEXEDTRIANGLELIST = 3,
-  D3DDP2OP_RESERVED0           = 4,
   D3DDP2OP_RENDERSTATE         = 8,
   D3DDP2OP_LINELIST            = 15,
   D3DDP2OP_LINESTRIP           = 16,
@@ -329,7 +366,6 @@ typedef enum _D3DHAL_DP2OPERATION {
   D3DDP2OP_SETLIGHT            = 34,
   D3DDP2OP_CREATELIGHT         = 35,
   D3DDP2OP_SETTRANSFORM                = 36,
-  D3DDP2OP_EXT                 = 37,
   D3DDP2OP_TEXBLT              = 38,
   D3DDP2OP_STATESET            = 39,
   D3DDP2OP_SETPRIORITY         = 40,
@@ -338,7 +374,58 @@ typedef enum _D3DHAL_DP2OPERATION {
   D3DDP2OP_CLEAR               = 42,
   /* DirectX 7 interfaces */
   D3DDP2OP_SETTEXLOD           = 43,
-  D3DPP2OP_SETCLIPPLANE                = 44
+  D3DPP2OP_SETCLIPPLANE                = 44,
+#if(DIRECT3D_VERSION >= 0x0800)
+  D3DDP2OP_CREATEVERTEXSHADER   = 45,
+  D3DDP2OP_DELETEVERTEXSHADER   = 46,
+  D3DDP2OP_SETVERTEXSHADER      = 47,
+  D3DDP2OP_SETVERTEXSHADERCONST = 48,
+  D3DDP2OP_SETSTREAMSOURCE      = 49,
+  D3DDP2OP_SETSTREAMSOURCEUM    = 50,
+  D3DDP2OP_SETINDICES           = 51,
+  D3DDP2OP_DRAWPRIMITIVE        = 52,
+  D3DDP2OP_DRAWINDEXEDPRIMITIVE = 53,
+  D3DDP2OP_CREATEPIXELSHADER    = 54,
+  D3DDP2OP_DELETEPIXELSHADER    = 55,
+  D3DDP2OP_SETPIXELSHADER       = 56,
+  D3DDP2OP_SETPIXELSHADERCONST  = 57,
+  D3DDP2OP_CLIPPEDTRIANGLEFAN   = 58,
+  D3DDP2OP_DRAWPRIMITIVE2       = 59,
+  D3DDP2OP_DRAWINDEXEDPRIMITIVE2= 60,
+  D3DDP2OP_DRAWRECTPATCH        = 61,
+  D3DDP2OP_DRAWTRIPATCH         = 62,
+  D3DDP2OP_VOLUMEBLT            = 63,
+  D3DDP2OP_BUFFERBLT            = 64,
+  D3DDP2OP_MULTIPLYTRANSFORM    = 65,
+  D3DDP2OP_ADDDIRTYRECT         = 66,
+  D3DDP2OP_ADDDIRTYBOX          = 67,
+#endif
+#if(DIRECT3D_VERSION >= 0x0900)
+  D3DDP2OP_CREATEVERTEXSHADERDECL   = 71,
+  D3DDP2OP_DELETEVERTEXSHADERDECL   = 72,
+  D3DDP2OP_SETVERTEXSHADERDECL      = 73,
+  D3DDP2OP_CREATEVERTEXSHADERFUNC   = 74,
+  D3DDP2OP_DELETEVERTEXSHADERFUNC   = 75,
+  D3DDP2OP_SETVERTEXSHADERFUNC      = 76,
+  D3DDP2OP_SETVERTEXSHADERCONSTI    = 77,
+  D3DDP2OP_SETSCISSORRECT           = 79,
+  D3DDP2OP_SETSTREAMSOURCE2         = 80,
+  D3DDP2OP_BLT                      = 81,
+  D3DDP2OP_COLORFILL                = 82,
+  D3DDP2OP_SETVERTEXSHADERCONSTB    = 83,
+  D3DDP2OP_CREATEQUERY              = 84,
+  D3DDP2OP_SETRENDERTARGET2         = 85,
+  D3DDP2OP_SETDEPTHSTENCIL          = 86,
+  D3DDP2OP_RESPONSECONTINUE         = 87,
+  D3DDP2OP_RESPONSEQUERY            = 88,
+  D3DDP2OP_GENERATEMIPSUBLEVELS     = 89,
+  D3DDP2OP_DELETEQUERY              = 90,
+  D3DDP2OP_ISSUEQUERY               = 91,
+  D3DDP2OP_SETPIXELSHADERCONSTI     = 93,
+  D3DDP2OP_SETPIXELSHADERCONSTB     = 94,
+  D3DDP2OP_SETSTREAMSOURCEFREQ      = 95,
+  D3DDP2OP_SURFACEBLT               = 96
+#endif
 } D3DHAL_DP2OPERATION;
 
 /* point primitives */
@@ -519,17 +606,214 @@ typedef struct _D3DHAL_DP2SETTEXLOD {
   DWORD dwLOD;
 } D3DHAL_DP2SETTEXLOD,*LPD3DHAL_DP2SETTEXLOD;
 
-typedef struct _D3DHAL_VALIDATETEXTURESTAGESTATEDATA
+
+#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
 {
-    ULONG_PTR           dwhContext;
-    DWORD           dwFlags;
-    DWORD           dwReserved;
-    DWORD           dwNumPasses;
-    HRESULT         ddrval;
-} D3DHAL_VALIDATETEXTURESTAGESTATEDATA;
+    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 _D3DCAPS8
+{
+  D3DDEVTYPE DeviceType;
+  UINT AdapterOrdinal;
+  DWORD Caps;
+  DWORD Caps2;
+  DWORD Caps3;
+  DWORD PresentationIntervals;
+  DWORD CursorCaps;
+  DWORD DevCaps;
+  DWORD PrimitiveMiscCaps;
+  DWORD RasterCaps;
+  DWORD ZCmpCaps;
+  DWORD SrcBlendCaps;
+  DWORD DestBlendCaps;
+  DWORD AlphaCmpCaps;
+  DWORD ShadeCaps;
+  DWORD TextureCaps;
+  DWORD TextureFilterCaps;
+  DWORD CubeTextureFilterCaps;
+  DWORD VolumeTextureFilterCaps;
+  DWORD TextureAddressCaps;
+  DWORD VolumeTextureAddressCaps;
+  DWORD LineCaps;
+  DWORD MaxTextureWidth;
+  DWORD MaxTextureHeight;
+  DWORD MaxVolumeExtent;
+  DWORD MaxTextureRepeat;
+  DWORD MaxTextureAspectRatio;
+  DWORD MaxAnisotropy;
+  float MaxVertexW;
+  float GuardBandLeft;
+  float GuardBandTop;
+  float GuardBandRight;
+  float GuardBandBottom;
+  float ExtentsAdjust;
+  DWORD StencilCaps;
+  DWORD FVFCaps;
+  DWORD TextureOpCaps;
+  DWORD MaxTextureBlendStages;
+  DWORD MaxSimultaneousTextures;
+  DWORD VertexProcessingCaps;
+  DWORD MaxActiveLights;
+  DWORD MaxUserClipPlanes;
+  DWORD MaxVertexBlendMatrices;
+  DWORD MaxVertexBlendMatrixIndex;
+  float MaxPointSize;
+  DWORD MaxPrimitiveCount;
+  DWORD MaxVertexIndex;
+  DWORD MaxStreams;
+  DWORD MaxStreamStride;
+  DWORD VertexShaderVersion;
+  DWORD MaxVertexShaderConst;
+  DWORD PixelShaderVersion;
+  float MaxPixelShaderValue;
+} D3DCAPS8;
+
+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;
+    __GNU_EXTENSION 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
 
-#endif /* __WINE_DDRAWI_H */
+#endif /* _D3DHAL_H_ */