1 /* 2 * d3dnthal.h 3 * 4 * Direct3D NT driver interface 5 * 6 * Contributors: 7 * Created by Ge van Geldorp 8 * 9 * THIS SOFTWARE IS NOT COPYRIGHTED 10 * 11 * This source code is offered for use in the public domain. You may 12 * use, modify or distribute it freely. 13 * 14 * This code is distributed in the hope that it will be useful but 15 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 16 * DISCLAIMED. This includes but is not limited to warranties of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * 19 */ 20 21 #ifndef __DDK_D3DNTHAL_H 22 #define __DDK_D3DNTHAL_H 23 24 #include <ddrawint.h> 25 #include <d3dtypes.h> 26 #include <d3dcaps.h> 27 #include <d3dkmthk.h> 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 DEFINE_GUID(GUID_D3DCallbacks, 0x7BF06990, 0x8794, 0x11D0, 0x91, 0x39, 0x08, 0x00, 0x36, 0xD2, 0xEF, 0x02); 34 DEFINE_GUID(GUID_D3DCallbacks3, 0xDDF41230, 0xEC0A, 0x11D0, 0xA9, 0xB6, 0x00, 0xAA, 0x00, 0xC0, 0x99, 0x3E); 35 DEFINE_GUID(GUID_D3DExtendedCaps, 0x7DE41F80, 0x9D93, 0x11D0, 0x89, 0xAB, 0x00, 0xA0, 0xC9, 0x05, 0x41, 0x29); 36 DEFINE_GUID(GUID_D3DParseUnknownCommandCallback, 0x2E04FFA0, 0x98E4, 0x11D1, 0x8C, 0xE1, 0x00, 0xA0, 0xC9, 0x06, 0x29, 0xA8); 37 DEFINE_GUID(GUID_ZPixelFormats, 0x93869880, 0x36CF, 0x11D1, 0x9B, 0x1B, 0x00, 0xAA, 0x00, 0xBB, 0xB8, 0xAE); 38 DEFINE_GUID(GUID_DDStereoMode, 0xF828169C, 0xA8E8, 0x11D2, 0xA1, 0xF2, 0x00, 0xA0, 0xC9, 0x83, 0xEA, 0xF6); 39 40 typedef struct _D3DNTHAL_CONTEXTCREATEDATA { 41 __GNU_EXTENSION union { 42 PDD_DIRECTDRAW_GLOBAL lpDDGbl; 43 PDD_DIRECTDRAW_LOCAL lpDDLcl; 44 }; 45 __GNU_EXTENSION union { 46 PDD_SURFACE_LOCAL lpDDS; 47 PDD_SURFACE_LOCAL lpDDSLcl; 48 }; 49 __GNU_EXTENSION union { 50 PDD_SURFACE_LOCAL lpDDSZ; 51 PDD_SURFACE_LOCAL lpDDSZLcl; 52 }; 53 DWORD dwPID; 54 ULONG_PTR dwhContext; 55 HRESULT ddrval; 56 } D3DNTHAL_CONTEXTCREATEDATA, *LPD3DNTHAL_CONTEXTCREATEDATA; 57 58 typedef struct _D3DNTHAL_CONTEXTDESTROYDATA { 59 ULONG_PTR dwhContext; 60 HRESULT ddrval; 61 } D3DNTHAL_CONTEXTDESTROYDATA, *LPD3DNTHAL_CONTEXTDESTROYDATA; 62 63 typedef struct _D3DNTHAL_CONTEXTDESTROYALLDATA { 64 DWORD dwPID; 65 HRESULT ddrval; 66 } D3DNTHAL_CONTEXTDESTROYALLDATA, *LPD3DNTHAL_CONTEXTDESTROYALLDATA; 67 68 typedef struct _D3DNTHAL_SCENECAPTUREDATA { 69 ULONG_PTR dwhContext; 70 DWORD dwFlag; 71 HRESULT ddrval; 72 } D3DNTHAL_SCENECAPTUREDATA, *LPD3DNTHAL_SCENECAPTUREDATA; 73 74 typedef struct _D3DNTHAL_TEXTURECREATEDATA { 75 ULONG_PTR dwhContext; 76 HANDLE hDDS; 77 ULONG_PTR dwHandle; 78 HRESULT ddrval; 79 } D3DNTHAL_TEXTURECREATEDATA, *LPD3DNTHAL_TEXTURECREATEDATA; 80 81 typedef struct _D3DNTHAL_TEXTUREDESTROYDATA { 82 ULONG_PTR dwhContext; 83 ULONG_PTR dwHandle; 84 HRESULT ddrval; 85 } D3DNTHAL_TEXTUREDESTROYDATA, *LPD3DNTHAL_TEXTUREDESTROYDATA; 86 87 typedef struct _D3DNTHAL_TEXTURESWAPDATA { 88 ULONG_PTR dwhContext; 89 ULONG_PTR dwHandle1; 90 ULONG_PTR dwHandle2; 91 HRESULT ddrval; 92 } D3DNTHAL_TEXTURESWAPDATA, *LPD3DNTHAL_TEXTURESWAPDATA; 93 94 typedef struct _D3DNTHAL_TEXTUREGETSURFDATA { 95 ULONG_PTR dwhContext; 96 HANDLE hDDS; 97 ULONG_PTR dwHandle; 98 HRESULT ddrval; 99 } D3DNTHAL_TEXTUREGETSURFDATA, *LPD3DNTHAL_TEXTUREGETSURFDATA; 100 101 typedef DWORD (APIENTRY *LPD3DNTHAL_CONTEXTCREATECB)(LPD3DNTHAL_CONTEXTCREATEDATA); 102 typedef DWORD (APIENTRY *LPD3DNTHAL_CONTEXTDESTROYCB)(LPD3DNTHAL_CONTEXTDESTROYDATA); 103 typedef DWORD (APIENTRY *LPD3DNTHAL_CONTEXTDESTROYALLCB)(LPD3DNTHAL_CONTEXTDESTROYALLDATA); 104 typedef DWORD (APIENTRY *LPD3DNTHAL_SCENECAPTURECB)(LPD3DNTHAL_SCENECAPTUREDATA); 105 typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTURECREATECB)(LPD3DNTHAL_TEXTURECREATEDATA); 106 typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTUREDESTROYCB)(LPD3DNTHAL_TEXTUREDESTROYDATA); 107 typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTURESWAPCB)(LPD3DNTHAL_TEXTURESWAPDATA); 108 typedef DWORD (APIENTRY *LPD3DNTHAL_TEXTUREGETSURFCB)(LPD3DNTHAL_TEXTUREGETSURFDATA); 109 110 typedef struct _D3DNTHALDeviceDesc_V1 { 111 DWORD dwSize; 112 DWORD dwFlags; 113 D3DCOLORMODEL dcmColorModel; 114 DWORD dwDevCaps; 115 D3DTRANSFORMCAPS dtcTransformCaps; 116 BOOL bClipping; 117 D3DLIGHTINGCAPS dlcLightingCaps; 118 D3DPRIMCAPS dpcLineCaps; 119 D3DPRIMCAPS dpcTriCaps; 120 DWORD dwDeviceRenderBitDepth; 121 DWORD dwDeviceZBufferBitDepth; 122 DWORD dwMaxBufferSize; 123 DWORD dwMaxVertexCount; 124 } D3DNTHALDEVICEDESC_V1, *LPD3DNTHALDEVICEDESC_V1; 125 126 typedef struct _D3DNTHAL_GLOBALDRIVERDATA { 127 DWORD dwSize; 128 D3DNTHALDEVICEDESC_V1 hwCaps; 129 DWORD dwNumVertices; 130 DWORD dwNumClipVertices; 131 DWORD dwNumTextureFormats; 132 LPDDSURFACEDESC lpTextureFormats; 133 } D3DNTHAL_GLOBALDRIVERDATA, *LPD3DNTHAL_GLOBALDRIVERDATA; 134 135 typedef struct _D3DNTHAL_CALLBACKS { 136 DWORD dwSize; 137 LPD3DNTHAL_CONTEXTCREATECB ContextCreate; 138 LPD3DNTHAL_CONTEXTDESTROYCB ContextDestroy; 139 LPD3DNTHAL_CONTEXTDESTROYALLCB ContextDestroyAll; 140 LPD3DNTHAL_SCENECAPTURECB SceneCapture; 141 LPVOID dwReserved10; 142 LPVOID dwReserved11; 143 LPVOID dwReserved22; 144 LPVOID dwReserved23; 145 ULONG_PTR dwReserved; 146 LPD3DNTHAL_TEXTURECREATECB TextureCreate; 147 LPD3DNTHAL_TEXTUREDESTROYCB TextureDestroy; 148 LPD3DNTHAL_TEXTURESWAPCB TextureSwap; 149 LPD3DNTHAL_TEXTUREGETSURFCB TextureGetSurf; 150 LPVOID dwReserved12; 151 LPVOID dwReserved13; 152 LPVOID dwReserved14; 153 LPVOID dwReserved15; 154 LPVOID dwReserved16; 155 LPVOID dwReserved17; 156 LPVOID dwReserved18; 157 LPVOID dwReserved19; 158 LPVOID dwReserved20; 159 LPVOID dwReserved21; 160 LPVOID dwReserved24; 161 ULONG_PTR dwReserved0; 162 ULONG_PTR dwReserved1; 163 ULONG_PTR dwReserved2; 164 ULONG_PTR dwReserved3; 165 ULONG_PTR dwReserved4; 166 ULONG_PTR dwReserved5; 167 ULONG_PTR dwReserved6; 168 ULONG_PTR dwReserved7; 169 ULONG_PTR dwReserved8; 170 ULONG_PTR dwReserved9; 171 } D3DNTHAL_CALLBACKS, *LPD3DNTHAL_CALLBACKS; 172 173 typedef struct _D3DNTHAL_SETRENDERTARGETDATA { 174 ULONG_PTR dwhContext; 175 PDD_SURFACE_LOCAL lpDDS; 176 PDD_SURFACE_LOCAL lpDDSZ; 177 HRESULT ddrval; 178 } D3DNTHAL_SETRENDERTARGETDATA, *LPD3DNTHAL_SETRENDERTARGETDATA; 179 180 typedef DWORD (APIENTRY *LPD3DNTHAL_SETRENDERTARGETCB)(LPD3DNTHAL_SETRENDERTARGETDATA); 181 182 typedef struct _D3DNTHAL_CALLBACKS2 { 183 DWORD dwSize; 184 DWORD dwFlags; 185 LPD3DNTHAL_SETRENDERTARGETCB SetRenderTarget; 186 LPVOID dwReserved1; 187 LPVOID dwReserved2; 188 LPVOID dwReserved3; 189 LPVOID dwReserved4; 190 } D3DNTHAL_CALLBACKS2, *LPD3DNTHAL_CALLBACKS2; 191 192 typedef struct _D3DNTHAL_CLEAR2DATA { 193 ULONG_PTR dwhContext; 194 DWORD dwFlags; 195 DWORD dwFillColor; 196 D3DVALUE dvFillDepth; 197 DWORD dwFillStencil; 198 LPD3DRECT lpRects; 199 DWORD dwNumRects; 200 HRESULT ddrval; 201 } D3DNTHAL_CLEAR2DATA, FAR *LPD3DNTHAL_CLEAR2DATA; 202 203 typedef struct _D3DNTHAL_VALIDATETEXTURESTAGESTATEDATA { 204 ULONG_PTR dwhContext; 205 DWORD dwFlags; 206 ULONG_PTR dwReserved; 207 DWORD dwNumPasses; 208 HRESULT ddrval; 209 } D3DNTHAL_VALIDATETEXTURESTAGESTATEDATA, FAR *LPD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA; 210 211 typedef struct _D3DNTHAL_DRAWPRIMITIVES2DATA { 212 ULONG_PTR dwhContext; 213 DWORD dwFlags; 214 DWORD dwVertexType; 215 PDD_SURFACE_LOCAL lpDDCommands; 216 DWORD dwCommandOffset; 217 DWORD dwCommandLength; 218 __GNU_EXTENSION union { 219 PDD_SURFACE_LOCAL lpDDVertex; 220 LPVOID lpVertices; 221 }; 222 DWORD dwVertexOffset; 223 DWORD dwVertexLength; 224 DWORD dwReqVertexBufSize; 225 DWORD dwReqCommandBufSize; 226 LPDWORD lpdwRStates; 227 __GNU_EXTENSION union { 228 DWORD dwVertexSize; 229 HRESULT ddrval; 230 }; 231 DWORD dwErrorOffset; 232 } D3DNTHAL_DRAWPRIMITIVES2DATA, FAR *LPD3DNTHAL_DRAWPRIMITIVES2DATA; 233 234 typedef DWORD (APIENTRY *LPD3DNTHAL_CLEAR2CB)(LPD3DNTHAL_CLEAR2DATA); 235 typedef DWORD (APIENTRY *LPD3DNTHAL_VALIDATETEXTURESTAGESTATECB)(LPD3DNTHAL_VALIDATETEXTURESTAGESTATEDATA); 236 typedef DWORD (APIENTRY *LPD3DNTHAL_DRAWPRIMITIVES2CB)(LPD3DNTHAL_DRAWPRIMITIVES2DATA); 237 238 typedef struct _D3DNTHAL_CALLBACKS3 { 239 DWORD dwSize; 240 DWORD dwFlags; 241 LPD3DNTHAL_CLEAR2CB Clear2; 242 LPVOID lpvReserved; 243 LPD3DNTHAL_VALIDATETEXTURESTAGESTATECB ValidateTextureStageState; 244 LPD3DNTHAL_DRAWPRIMITIVES2CB DrawPrimitives2; 245 } D3DNTHAL_CALLBACKS3, *LPD3DNTHAL_CALLBACKS3; 246 247 #ifdef __cplusplus 248 } /* extern "C" */ 249 #endif 250 251 #endif /* __DDK_D3DNTHAL_H */ 252