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