2 * Direct3D 8 private include file
4 * Copyright 2002 Jason Edmeades
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_D3D8_PRIVATE_H
22 #define __WINE_D3D8_PRIVATE_H
24 #ifndef __WINE_CONFIG_H
25 # error You must include config.h to use this header
28 /* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES */
29 #define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */
32 #ifdef HAVE_GL_GLEXT_H
33 # include <GL/glext.h>
41 /* Redefines the constants */
42 #define CALLBACK __stdcall
43 #define WINAPI __stdcall
44 #define APIENTRY WINAPI
48 extern void (*wine_tsx11_lock_ptr)(void);
49 extern void (*wine_tsx11_unlock_ptr)(void);
51 /* As GLX relies on X, this is needed */
54 #define ENTER_GL() ++num_lock; TRACE("inc lock to: %d\n", num_lock); wine_tsx11_lock_ptr()
55 #define LEAVE_GL() if (num_lock > 2) TRACE("fucking locks: %d\n", num_lock); --num_lock; wine_tsx11_unlock_ptr()
57 #define ENTER_GL() wine_tsx11_lock_ptr()
58 #define LEAVE_GL() wine_tsx11_unlock_ptr()
64 #define MAX_PALETTES 256
65 #define MAX_STREAMS 16
66 #define MAX_ACTIVE_LIGHTS 8
67 #define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
68 #define MAX_LEVELS 256
70 /* Other useful values */
71 #define HIGHEST_RENDER_STATE 174
72 #define HIGHEST_TEXTURE_STATE 29
73 #define HIGHEST_TRANSFORMSTATE 512
74 #define D3DSBT_RECORDED 0xfffffffe
76 /* CreateVertexShader can return > 0xFFFF */
77 #define VS_HIGHESTFIXEDFXF 0xF0000000
78 #define VERTEX_SHADER(Handle) \
79 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(VertexShaders) / sizeof(IDirect3DVertexShaderImpl*)) ? NULL : VertexShaders[Handle]) : VertexShaders[Handle - VS_HIGHESTFIXEDFXF])
80 #define VERTEX_SHADER_DECL(Handle) \
81 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(VertexShaderDeclarations) / sizeof(IDirect3DVertexShaderDeclarationImpl*)) ? NULL : VertexShaderDeclarations[Handle]) : VertexShaderDeclarations[Handle - VS_HIGHESTFIXEDFXF])
82 #define PIXEL_SHADER(Handle) \
83 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(PixelShaders) / sizeof(IDirect3DPixelShaderImpl*)) ? NULL : PixelShaders[Handle]) : PixelShaders[Handle - VS_HIGHESTFIXEDFXF])
85 /* Direct3D8 Interfaces: */
86 typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
87 typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
88 typedef struct IDirect3D8Impl IDirect3D8Impl;
89 typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
90 typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
91 typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
92 typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
93 typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
94 typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
95 typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
96 typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
97 typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
99 /** Private Interfaces: */
100 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
101 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
102 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
103 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
105 typedef struct D3DSHADERVECTOR {
112 typedef struct D3DSHADERSCALAR {
116 #define D3D8_VSHADER_MAX_CONSTANTS 96
117 typedef D3DSHADERVECTOR VSHADERCONSTANTS8[D3D8_VSHADER_MAX_CONSTANTS];
119 typedef struct VSHADERDATA8 {
120 /** Run Time Shader Function Constants */
121 /*D3DXBUFFER* constants;*/
123 /** Shader Code as char ... */
128 /** temporary here waiting for buffer code */
129 typedef struct VSHADERINPUTDATA8 {
130 D3DSHADERVECTOR V[17];
133 /** temporary here waiting for buffer code */
134 typedef struct VSHADEROUTPUTDATA8 {
135 D3DSHADERVECTOR oPos;
136 D3DSHADERVECTOR oD[2];
137 D3DSHADERVECTOR oT[8];
138 D3DSHADERVECTOR oFog;
139 D3DSHADERVECTOR oPts;
140 } VSHADEROUTPUTDATA8;
143 #define D3D8_PSHADER_MAX_CONSTANTS 32
144 typedef D3DSHADERVECTOR PSHADERCONSTANTS8[D3D8_PSHADER_MAX_CONSTANTS];
146 typedef struct PSHADERDATA8 {
147 /** Run Time Shader Function Constants */
148 /*D3DXBUFFER* constants;*/
150 /** Shader Code as char ... */
155 /** temporary here waiting for buffer code */
156 typedef struct PSHADERINPUTDATA8 {
157 D3DSHADERVECTOR V[2];
158 D3DSHADERVECTOR T[8];
159 D3DSHADERVECTOR S[16];
160 /*D3DSHADERVECTOR R[12];*/
163 /** temporary here waiting for buffer code */
164 typedef struct PSHADEROUTPUTDATA8 {
165 D3DSHADERVECTOR oC[4];
166 D3DSHADERVECTOR oDepth;
167 } PSHADEROUTPUTDATA8;
173 #define checkGLcall(A) \
175 GLint err = glGetError(); \
176 if (err != GL_NO_ERROR) { \
177 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
179 TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \
182 #define vcheckGLcall(A) \
184 GLint err = glGetError(); \
185 if (err != GL_NO_ERROR) { \
186 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
188 VTRACE(("%s call ok %s / %d\n", A, __FILE__, __LINE__)); \
192 #include "d3dcore_gl.h"
195 #define GL_LIMITS(ExtName) (This->direct3d8->gl_info.max_##ExtName)
196 #define GL_SUPPORT(ExtName) (TRUE == This->direct3d8->gl_info.supported[ExtName])
197 #define GL_SUPPORT_DEV(ExtName, dev) (TRUE == (dev)->direct3d8->gl_info.supported[ExtName])
198 #define GL_EXTCALL(FuncName) (This->direct3d8->gl_info.FuncName)
201 #define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f)
202 #define D3DCOLOR_G(dw) (((float) (((dw) >> 8) & 0xFF)) / 255.0f)
203 #define D3DCOLOR_B(dw) (((float) (((dw) >> 0) & 0xFF)) / 255.0f)
204 #define D3DCOLOR_A(dw) (((float) (((dw) >> 24) & 0xFF)) / 255.0f)
206 #define D3DCOLORTOCOLORVALUE(dw, col) \
207 (col).r = D3DCOLOR_R(dw); \
208 (col).g = D3DCOLOR_G(dw); \
209 (col).b = D3DCOLOR_B(dw); \
210 (col).a = D3DCOLOR_A(dw);
212 #define D3DCOLORTOVECTOR4(dw, vec) \
213 (vec).x = D3DCOLOR_R(dw); \
214 (vec).y = D3DCOLOR_G(dw); \
215 (vec).z = D3DCOLOR_B(dw); \
216 (vec).w = D3DCOLOR_A(dw);
218 #define D3DCOLORTOGLFLOAT4(dw, vec) \
219 (vec)[0] = D3DCOLOR_R(dw); \
220 (vec)[1] = D3DCOLOR_G(dw); \
221 (vec)[2] = D3DCOLOR_B(dw); \
222 (vec)[3] = D3DCOLOR_A(dw);
224 /* ===========================================================================
225 The interfactes themselves
226 =========================================================================== */
232 /*****************************************************************************
233 * Predeclare the interface implementation structures
235 extern ICOM_VTABLE(IDirect3D8) Direct3D8_Vtbl;
237 /*****************************************************************************
238 * IDirect3D implementation structure
240 struct IDirect3D8Impl
242 /* IUnknown fields */
243 ICOM_VFIELD(IDirect3D8);
246 /* IDirect3D8 fields */
251 extern HRESULT WINAPI IDirect3D8Impl_QueryInterface(LPDIRECT3D8 iface,REFIID refiid,LPVOID *obj);
252 extern ULONG WINAPI IDirect3D8Impl_AddRef(LPDIRECT3D8 iface);
253 extern ULONG WINAPI IDirect3D8Impl_Release(LPDIRECT3D8 iface);
256 extern HRESULT WINAPI IDirect3D8Impl_RegisterSoftwareDevice(LPDIRECT3D8 iface, void* pInitializeFunction);
257 extern UINT WINAPI IDirect3D8Impl_GetAdapterCount(LPDIRECT3D8 iface);
258 extern HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier(LPDIRECT3D8 iface, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER8* pIdentifier);
259 extern UINT WINAPI IDirect3D8Impl_GetAdapterModeCount(LPDIRECT3D8 iface, UINT Adapter);
260 extern HRESULT WINAPI IDirect3D8Impl_EnumAdapterModes(LPDIRECT3D8 iface, UINT Adapter, UINT Mode, D3DDISPLAYMODE* pMode);
261 extern HRESULT WINAPI IDirect3D8Impl_GetAdapterDisplayMode(LPDIRECT3D8 iface, UINT Adapter, D3DDISPLAYMODE* pMode);
262 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceType(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat,
263 D3DFORMAT BackBufferFormat, BOOL Windowed);
264 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
265 DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
266 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceMultiSampleType(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat,
267 BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType);
268 extern HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
269 D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
270 extern HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps);
271 extern HMONITOR WINAPI IDirect3D8Impl_GetAdapterMonitor(LPDIRECT3D8 iface, UINT Adapter);
272 extern HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
273 DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
274 IDirect3DDevice8** ppReturnedDeviceInterface);
276 /* ---------------- */
277 /* IDirect3DDevice8 */
278 /* ---------------- */
280 /*****************************************************************************
281 * Predeclare the interface implementation structures
283 extern ICOM_VTABLE(IDirect3DDevice8) Direct3DDevice8_Vtbl;
285 /*****************************************************************************
286 * IDirect3DDevice8 implementation structure
288 struct IDirect3DDevice8Impl
290 /* IUnknown fields */
291 ICOM_VFIELD(IDirect3DDevice8);
294 /* IDirect3DDevice8 fields */
295 IDirect3D8Impl *direct3d8;
297 IDirect3DSurface8Impl *frontBuffer;
298 IDirect3DSurface8Impl *backBuffer;
299 IDirect3DSurface8Impl *depthStencilBuffer;
301 IDirect3DSurface8Impl *renderTarget;
302 IDirect3DSurface8Impl *stencilBufferTarget;
304 D3DPRESENT_PARAMETERS PresentParms;
305 D3DDEVICE_CREATION_PARAMETERS CreateParms;
315 /* State block related */
316 BOOL isRecordingState;
317 IDirect3DStateBlockImpl *StateBlock;
318 IDirect3DStateBlockImpl *UpdateStateBlock;
320 /* Other required values */
321 float lightPosn[MAX_ACTIVE_LIGHTS][4];
322 float lightDirn[MAX_ACTIVE_LIGHTS][4];
324 /* palettes texture management */
325 PALETTEENTRY palettes[MAX_PALETTES][256];
331 D3DMATRIX lastWorld0;
332 D3DMATRIX lastTexTrans[8];
336 XVisualInfo *visInfo;
340 GLXContext render_ctx;
343 /* OpenGL Extension related */
345 /* Cursor management */
353 UINT dummyTextureName[8];
357 extern HRESULT WINAPI IDirect3DDevice8Impl_QueryInterface(LPDIRECT3DDEVICE8 iface, REFIID refiid, LPVOID *obj);
358 extern ULONG WINAPI IDirect3DDevice8Impl_AddRef(LPDIRECT3DDEVICE8 iface);
359 extern ULONG WINAPI IDirect3DDevice8Impl_Release(LPDIRECT3DDEVICE8 iface);
361 /* IDirect3DDevice8: */
362 extern HRESULT WINAPI IDirect3DDevice8Impl_TestCooperativeLevel(LPDIRECT3DDEVICE8 iface);
363 extern UINT WINAPI IDirect3DDevice8Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE8 iface);
364 extern HRESULT WINAPI IDirect3DDevice8Impl_ResourceManagerDiscardBytes(LPDIRECT3DDEVICE8 iface, DWORD Bytes);
365 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDirect3D(LPDIRECT3DDEVICE8 iface, IDirect3D8** ppD3D8);
366 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDeviceCaps(LPDIRECT3DDEVICE8 iface, D3DCAPS8* pCaps);
367 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDisplayMode(LPDIRECT3DDEVICE8 iface, D3DDISPLAYMODE* pMode);
368 extern HRESULT WINAPI IDirect3DDevice8Impl_GetCreationParameters(LPDIRECT3DDEVICE8 iface, D3DDEVICE_CREATION_PARAMETERS* pParameters);
369 extern HRESULT WINAPI IDirect3DDevice8Impl_SetCursorProperties(LPDIRECT3DDEVICE8 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8* pCursorBitmap);
370 extern void WINAPI IDirect3DDevice8Impl_SetCursorPosition(LPDIRECT3DDEVICE8 iface, UINT XScreenSpace, UINT YScreenSpace, DWORD Flags);
371 extern BOOL WINAPI IDirect3DDevice8Impl_ShowCursor(LPDIRECT3DDEVICE8 iface, BOOL bShow);
372 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain8** pSwapChain);
373 extern HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters);
374 extern HRESULT WINAPI IDirect3DDevice8Impl_Present(LPDIRECT3DDEVICE8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
375 extern HRESULT WINAPI IDirect3DDevice8Impl_GetBackBuffer(LPDIRECT3DDEVICE8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer);
376 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRasterStatus(LPDIRECT3DDEVICE8 iface, D3DRASTER_STATUS* pRasterStatus);
377 extern void WINAPI IDirect3DDevice8Impl_SetGammaRamp(LPDIRECT3DDEVICE8 iface, DWORD Flags, CONST D3DGAMMARAMP* pRamp);
378 extern void WINAPI IDirect3DDevice8Impl_GetGammaRamp(LPDIRECT3DDEVICE8 iface, D3DGAMMARAMP* pRamp);
379 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture8** ppTexture);
380 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture);
381 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture);
382 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer8** ppVertexBuffer);
383 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer8** ppIndexBuffer);
384 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateRenderTarget(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, BOOL Lockable, IDirect3DSurface8** ppSurface);
385 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, IDirect3DSurface8** ppSurface);
386 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateImageSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, IDirect3DSurface8** ppSurface);
387 extern HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, IDirect3DSurface8* pDestinationSurface, CONST POINT* pDestPointsArray);
388 extern HRESULT WINAPI IDirect3DDevice8Impl_UpdateTexture(LPDIRECT3DDEVICE8 iface, IDirect3DBaseTexture8* pSourceTexture, IDirect3DBaseTexture8* pDestinationTexture);
389 extern HRESULT WINAPI IDirect3DDevice8Impl_GetFrontBuffer(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pDestSurface);
390 extern HRESULT WINAPI IDirect3DDevice8Impl_SetRenderTarget(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pRenderTarget, IDirect3DSurface8* pNewZStencil);
391 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRenderTarget(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8** ppRenderTarget);
392 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8** ppZStencilSurface);
393 extern HRESULT WINAPI IDirect3DDevice8Impl_BeginScene(LPDIRECT3DDEVICE8 iface);
394 extern HRESULT WINAPI IDirect3DDevice8Impl_EndScene(LPDIRECT3DDEVICE8 iface);
395 extern HRESULT WINAPI IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil);
396 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
397 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
398 extern HRESULT WINAPI IDirect3DDevice8Impl_MultiplyTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
399 extern HRESULT WINAPI IDirect3DDevice8Impl_SetViewport(LPDIRECT3DDEVICE8 iface, CONST D3DVIEWPORT8* pViewport);
400 extern HRESULT WINAPI IDirect3DDevice8Impl_GetViewport(LPDIRECT3DDEVICE8 iface, D3DVIEWPORT8* pViewport);
401 extern HRESULT WINAPI IDirect3DDevice8Impl_SetMaterial(LPDIRECT3DDEVICE8 iface, CONST D3DMATERIAL8* pMaterial);
402 extern HRESULT WINAPI IDirect3DDevice8Impl_GetMaterial(LPDIRECT3DDEVICE8 iface, D3DMATERIAL8* pMaterial);
403 extern HRESULT WINAPI IDirect3DDevice8Impl_SetLight(LPDIRECT3DDEVICE8 iface, DWORD Index, CONST D3DLIGHT8* pLight);
404 extern HRESULT WINAPI IDirect3DDevice8Impl_GetLight(LPDIRECT3DDEVICE8 iface, DWORD Index, D3DLIGHT8* pLight);
405 extern HRESULT WINAPI IDirect3DDevice8Impl_LightEnable(LPDIRECT3DDEVICE8 iface, DWORD Index, BOOL Enable);
406 extern HRESULT WINAPI IDirect3DDevice8Impl_GetLightEnable(LPDIRECT3DDEVICE8 iface, DWORD Index, BOOL* pEnable);
407 extern HRESULT WINAPI IDirect3DDevice8Impl_SetClipPlane(LPDIRECT3DDEVICE8 iface, DWORD Index, CONST float* pPlane);
408 extern HRESULT WINAPI IDirect3DDevice8Impl_GetClipPlane(LPDIRECT3DDEVICE8 iface, DWORD Index, float* pPlane);
409 extern HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3DRENDERSTATETYPE State, DWORD Value);
410 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRenderState(LPDIRECT3DDEVICE8 iface, D3DRENDERSTATETYPE State, DWORD* pValue);
411 extern HRESULT WINAPI IDirect3DDevice8Impl_BeginStateBlock(LPDIRECT3DDEVICE8 iface);
412 extern HRESULT WINAPI IDirect3DDevice8Impl_EndStateBlock(LPDIRECT3DDEVICE8 iface, DWORD* pToken);
413 extern HRESULT WINAPI IDirect3DDevice8Impl_ApplyStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
414 extern HRESULT WINAPI IDirect3DDevice8Impl_CaptureStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
415 extern HRESULT WINAPI IDirect3DDevice8Impl_DeleteStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
416 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(LPDIRECT3DDEVICE8 iface, D3DSTATEBLOCKTYPE Type,DWORD* pToken);
417 extern HRESULT WINAPI IDirect3DDevice8Impl_SetClipStatus(LPDIRECT3DDEVICE8 iface, CONST D3DCLIPSTATUS8* pClipStatus);
418 extern HRESULT WINAPI IDirect3DDevice8Impl_GetClipStatus(LPDIRECT3DDEVICE8 iface, D3DCLIPSTATUS8* pClipStatus);
419 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage, IDirect3DBaseTexture8** ppTexture);
420 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage, IDirect3DBaseTexture8* pTexture);
421 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue);
422 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
423 extern HRESULT WINAPI IDirect3DDevice8Impl_ValidateDevice(LPDIRECT3DDEVICE8 iface, DWORD* pNumPasses);
424 extern HRESULT WINAPI IDirect3DDevice8Impl_GetInfo(LPDIRECT3DDEVICE8 iface, DWORD DevInfoID, void* pDevInfoStruct, DWORD DevInfoStructSize);
425 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPaletteEntries(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries);
426 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPaletteEntries(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber, PALETTEENTRY* pEntries);
427 extern HRESULT WINAPI IDirect3DDevice8Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber);
428 extern HRESULT WINAPI IDirect3DDevice8Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface, UINT *PaletteNumber);
429 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
430 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount);
431 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
432 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawIndexedPrimitiveUP(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertexIndices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
433 extern HRESULT WINAPI IDirect3DDevice8Impl_ProcessVertices(LPDIRECT3DDEVICE8 iface, UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags);
434 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage);
435 extern HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
436 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD* pHandle);
437 extern HRESULT WINAPI IDirect3DDevice8Impl_DeleteVertexShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
438 extern HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,CONST void* pConstantData,DWORD ConstantCount);
439 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,void* pConstantData,DWORD ConstantCount);
440 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderDeclaration(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
441 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
442 extern HRESULT WINAPI IDirect3DDevice8Impl_SetStreamSource(LPDIRECT3DDEVICE8 iface, UINT StreamNumber,IDirect3DVertexBuffer8* pStreamData,UINT Stride);
443 extern HRESULT WINAPI IDirect3DDevice8Impl_GetStreamSource(LPDIRECT3DDEVICE8 iface, UINT StreamNumber,IDirect3DVertexBuffer8** ppStreamData,UINT* pStride);
444 extern HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex);
445 extern HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex);
446 extern HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pFunction,DWORD* pHandle);
447 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
448 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD* pHandle);
449 extern HRESULT WINAPI IDirect3DDevice8Impl_DeletePixelShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
450 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,CONST void* pConstantData,DWORD ConstantCount);
451 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,void* pConstantData,DWORD ConstantCount);
452 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
453 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawRectPatch(LPDIRECT3DDEVICE8 iface, UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo);
454 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawTriPatch(LPDIRECT3DDEVICE8 iface, UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo);
455 extern HRESULT WINAPI IDirect3DDevice8Impl_DeletePatch(LPDIRECT3DDEVICE8 iface, UINT Handle);
457 /* internal Interfaces */
458 extern HRESULT WINAPI IDirect3DDevice8Impl_CleanRender(LPDIRECT3DDEVICE8 iface);
459 extern HRESULT WINAPI IDirect3DDevice8Impl_ActiveRender(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* RenderSurface, IDirect3DSurface8* StencilSurface);
462 /* ---------------- */
463 /* IDirect3DVolume8 */
464 /* ---------------- */
466 /*****************************************************************************
467 * Predeclare the interface implementation structures
469 extern ICOM_VTABLE(IDirect3DVolume8) Direct3DVolume8_Vtbl;
471 /*****************************************************************************
472 * IDirect3DVolume8 implementation structure
474 struct IDirect3DVolume8Impl
476 /* IUnknown fields */
477 ICOM_VFIELD(IDirect3DVolume8);
480 /* IDirect3DVolume8 fields */
481 IDirect3DDevice8Impl *Device;
482 D3DRESOURCETYPE ResourceType;
485 D3DVOLUME_DESC myDesc;
486 BYTE *allocatedMemory;
498 extern HRESULT WINAPI IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 iface,REFIID refiid,LPVOID *obj);
499 extern ULONG WINAPI IDirect3DVolume8Impl_AddRef(LPDIRECT3DVOLUME8 iface);
500 extern ULONG WINAPI IDirect3DVolume8Impl_Release(LPDIRECT3DVOLUME8 iface);
502 /* IDirect3DVolume8: */
503 extern HRESULT WINAPI IDirect3DVolume8Impl_GetDevice(LPDIRECT3DVOLUME8 iface, IDirect3DDevice8** ppDevice);
504 extern HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
505 extern HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
506 extern HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid);
507 extern HRESULT WINAPI IDirect3DVolume8Impl_GetContainer(LPDIRECT3DVOLUME8 iface, REFIID riid, void** ppContainer);
508 extern HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface, D3DVOLUME_DESC* pDesc);
509 extern HRESULT WINAPI IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
510 extern HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface);
512 /* internal Interfaces */
513 extern HRESULT WINAPI IDirect3DVolume8Impl_CleanDirtyBox(LPDIRECT3DVOLUME8 iface);
514 extern HRESULT WINAPI IDirect3DVolume8Impl_AddDirtyBox(LPDIRECT3DVOLUME8 iface, CONST D3DBOX* pDirtyBox);
516 /* ------------------- */
517 /* IDirect3DSwapChain8 */
518 /* ------------------- */
520 /*****************************************************************************
521 * Predeclare the interface implementation structures
523 extern ICOM_VTABLE(IDirect3DSwapChain8) Direct3DSwapChain8_Vtbl;
525 /*****************************************************************************
526 * IDirect3DSwapChain8 implementation structure
528 struct IDirect3DSwapChain8Impl
530 /* IUnknown fields */
531 ICOM_VFIELD(IDirect3DSwapChain8);
534 /* IDirect3DSwapChain8 fields */
535 IDirect3DSurface8Impl *frontBuffer;
536 IDirect3DSurface8Impl *backBuffer;
537 IDirect3DSurface8Impl *depthStencilBuffer;
538 D3DPRESENT_PARAMETERS PresentParms;
540 /* OpenGL/GLX related */
542 Drawable swap_drawable;
546 extern HRESULT WINAPI IDirect3DSwapChain8Impl_QueryInterface(LPDIRECT3DSWAPCHAIN8 iface, REFIID refiid, LPVOID *obj);
547 extern ULONG WINAPI IDirect3DSwapChain8Impl_AddRef(LPDIRECT3DSWAPCHAIN8 iface);
548 extern ULONG WINAPI IDirect3DSwapChain8Impl_Release(LPDIRECT3DSWAPCHAIN8 iface);
550 /* IDirect3DSwapChain8: */
551 extern HRESULT WINAPI IDirect3DSwapChain8Impl_Present(LPDIRECT3DSWAPCHAIN8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion);
552 extern HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer);
555 /* ----------------- */
556 /* IDirect3DSurface8 */
557 /* ----------------- */
559 /*****************************************************************************
560 * Predeclare the interface implementation structures
562 extern ICOM_VTABLE(IDirect3DSurface8) Direct3DSurface8_Vtbl;
564 /*****************************************************************************
565 * IDirect3DSurface8 implementation structure
567 struct IDirect3DSurface8Impl
569 /* IUnknown fields */
570 ICOM_VFIELD(IDirect3DSurface8);
573 /* IDirect3DSurface8 fields */
574 IDirect3DDevice8Impl *Device;
575 D3DRESOURCETYPE ResourceType;
578 D3DSURFACE_DESC myDesc;
579 BYTE *allocatedMemory;
591 extern HRESULT WINAPI IDirect3DSurface8Impl_QueryInterface(LPDIRECT3DSURFACE8 iface,REFIID refiid,LPVOID *obj);
592 extern ULONG WINAPI IDirect3DSurface8Impl_AddRef(LPDIRECT3DSURFACE8 iface);
593 extern ULONG WINAPI IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface);
595 /* IDirect3DSurface8: */
596 extern HRESULT WINAPI IDirect3DSurface8Impl_GetDevice(LPDIRECT3DSURFACE8 iface, IDirect3DDevice8** ppDevice);
597 extern HRESULT WINAPI IDirect3DSurface8Impl_SetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags);
598 extern HRESULT WINAPI IDirect3DSurface8Impl_GetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,void* pData,DWORD* pSizeOfData);
599 extern HRESULT WINAPI IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid);
600 extern HRESULT WINAPI IDirect3DSurface8Impl_GetContainer(LPDIRECT3DSURFACE8 iface, REFIID riid,void** ppContainer);
601 extern HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(LPDIRECT3DSURFACE8 iface, D3DSURFACE_DESC *pDesc);
602 extern HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect,DWORD Flags);
603 extern HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface);
605 /* internal Interfaces */
606 extern HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenum gl_target, GLenum gl_level);
607 extern HRESULT WINAPI IDirect3DSurface8Impl_SaveSnapshot(LPDIRECT3DSURFACE8 iface, const char* filename);
608 extern HRESULT WINAPI IDirect3DSurface8Impl_CleanDirtyRect(LPDIRECT3DSURFACE8 iface);
609 extern HRESULT WINAPI IDirect3DSurface8Impl_AddDirtyRect(LPDIRECT3DSURFACE8 iface, CONST RECT* pDirtyRect);
611 /* ------------------ */
612 /* IDirect3DResource8 */
613 /* ------------------ */
615 /*****************************************************************************
616 * Predeclare the interface implementation structures
618 extern ICOM_VTABLE(IDirect3DResource8) Direct3DResource8_Vtbl;
620 /*****************************************************************************
621 * IDirect3DResource8 implementation structure
623 struct IDirect3DResource8Impl
625 /* IUnknown fields */
626 ICOM_VFIELD(IDirect3DResource8);
629 /* IDirect3DResource8 fields */
630 IDirect3DDevice8Impl *Device;
631 D3DRESOURCETYPE ResourceType;
635 extern HRESULT WINAPI IDirect3DResource8Impl_QueryInterface(LPDIRECT3DRESOURCE8 iface,REFIID refiid,LPVOID *obj);
636 extern ULONG WINAPI IDirect3DResource8Impl_AddRef(LPDIRECT3DRESOURCE8 iface);
637 extern ULONG WINAPI IDirect3DResource8Impl_Release(LPDIRECT3DRESOURCE8 iface);
639 /* IDirect3DResource8: */
640 extern HRESULT WINAPI IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface, IDirect3DDevice8** ppDevice);
641 extern HRESULT WINAPI IDirect3DResource8Impl_SetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
642 extern HRESULT WINAPI IDirect3DResource8Impl_GetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
643 extern HRESULT WINAPI IDirect3DResource8Impl_FreePrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid);
644 extern DWORD WINAPI IDirect3DResource8Impl_SetPriority(LPDIRECT3DRESOURCE8 iface, DWORD PriorityNew);
645 extern DWORD WINAPI IDirect3DResource8Impl_GetPriority(LPDIRECT3DRESOURCE8 iface);
646 extern void WINAPI IDirect3DResource8Impl_PreLoad(LPDIRECT3DRESOURCE8 iface);
647 extern D3DRESOURCETYPE WINAPI IDirect3DResource8Impl_GetType(LPDIRECT3DRESOURCE8 iface);
649 /* internal Interfaces */
650 extern D3DPOOL WINAPI IDirect3DResource8Impl_GetPool(LPDIRECT3DRESOURCE8 iface);
653 /* ---------------------- */
654 /* IDirect3DVertexBuffer8 */
655 /* ---------------------- */
657 /*****************************************************************************
658 * Predeclare the interface implementation structures
660 extern ICOM_VTABLE(IDirect3DVertexBuffer8) Direct3DVertexBuffer8_Vtbl;
662 /*****************************************************************************
663 * IDirect3DVertexBuffer8 implementation structure
665 struct IDirect3DVertexBuffer8Impl
667 /* IUnknown fields */
668 ICOM_VFIELD(IDirect3DVertexBuffer8);
671 /* IDirect3DResource8 fields */
672 IDirect3DDevice8Impl *Device;
673 D3DRESOURCETYPE ResourceType;
675 /* IDirect3DVertexBuffer8 fields */
676 BYTE *allocatedMemory;
677 D3DVERTEXBUFFER_DESC currentDesc;
681 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_QueryInterface(LPDIRECT3DVERTEXBUFFER8 iface,REFIID refiid,LPVOID *obj);
682 extern ULONG WINAPI IDirect3DVertexBuffer8Impl_AddRef(LPDIRECT3DVERTEXBUFFER8 iface);
683 extern ULONG WINAPI IDirect3DVertexBuffer8Impl_Release(LPDIRECT3DVERTEXBUFFER8 iface);
685 /* IDirect3DVertexBuffer8: (Inherited from IDirect3DResource8) */
686 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDevice(LPDIRECT3DVERTEXBUFFER8 iface, IDirect3DDevice8** ppDevice);
687 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
688 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
689 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_FreePrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid);
690 extern DWORD WINAPI IDirect3DVertexBuffer8Impl_SetPriority(LPDIRECT3DVERTEXBUFFER8 iface, DWORD PriorityNew);
691 extern DWORD WINAPI IDirect3DVertexBuffer8Impl_GetPriority(LPDIRECT3DVERTEXBUFFER8 iface);
692 extern void WINAPI IDirect3DVertexBuffer8Impl_PreLoad(LPDIRECT3DVERTEXBUFFER8 iface);
693 extern D3DRESOURCETYPE WINAPI IDirect3DVertexBuffer8Impl_GetType(LPDIRECT3DVERTEXBUFFER8 iface);
695 /* IDirect3DVertexBuffer8: */
696 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_Lock(LPDIRECT3DVERTEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
697 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_Unlock(LPDIRECT3DVERTEXBUFFER8 iface);
698 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8 iface, D3DVERTEXBUFFER_DESC *pDesc);
701 /* --------------------- */
702 /* IDirect3DIndexBuffer8 */
703 /* --------------------- */
705 /*****************************************************************************
706 * Predeclare the interface implementation structures
708 extern ICOM_VTABLE(IDirect3DIndexBuffer8) Direct3DIndexBuffer8_Vtbl;
710 /*****************************************************************************
711 * IDirect3DIndexBuffer8 implementation structure
713 struct IDirect3DIndexBuffer8Impl
715 /* IUnknown fields */
716 ICOM_VFIELD(IDirect3DIndexBuffer8);
719 /* IDirect3DResource8 fields */
720 IDirect3DDevice8Impl *Device;
721 D3DRESOURCETYPE ResourceType;
723 /* IDirect3DIndexBuffer8 fields */
724 void *allocatedMemory;
725 D3DINDEXBUFFER_DESC currentDesc;
729 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_QueryInterface(LPDIRECT3DINDEXBUFFER8 iface,REFIID refiid,LPVOID *obj);
730 extern ULONG WINAPI IDirect3DIndexBuffer8Impl_AddRef(LPDIRECT3DINDEXBUFFER8 iface);
731 extern ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 iface);
733 /* IDirect3DIndexBuffer8: (Inherited from IDirect3DResource8) */
734 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDevice(LPDIRECT3DINDEXBUFFER8 iface, IDirect3DDevice8** ppDevice);
735 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
736 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
737 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid);
738 extern DWORD WINAPI IDirect3DIndexBuffer8Impl_SetPriority(LPDIRECT3DINDEXBUFFER8 iface, DWORD PriorityNew);
739 extern DWORD WINAPI IDirect3DIndexBuffer8Impl_GetPriority(LPDIRECT3DINDEXBUFFER8 iface);
740 extern void WINAPI IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 iface);
741 extern D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer8Impl_GetType(LPDIRECT3DINDEXBUFFER8 iface);
743 /* IDirect3DIndexBuffer8: */
744 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
745 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 iface);
746 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 iface, D3DINDEXBUFFER_DESC *pDesc);
749 /* --------------------- */
750 /* IDirect3DBaseTexture8 */
751 /* --------------------- */
753 /*****************************************************************************
754 * Predeclare the interface implementation structures
756 extern ICOM_VTABLE(IDirect3DBaseTexture8) Direct3DBaseTexture8_Vtbl;
758 /*****************************************************************************
759 * IDirect3DBaseTexture8 implementation structure
761 struct IDirect3DBaseTexture8Impl
763 /* IUnknown fields */
764 ICOM_VFIELD(IDirect3DBaseTexture8);
767 /* IDirect3DResource8 fields */
768 IDirect3DDevice8Impl *Device;
769 D3DRESOURCETYPE ResourceType;
771 /* IDirect3DBaseTexture8 fields */
782 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_QueryInterface(LPDIRECT3DBASETEXTURE8 iface,REFIID refiid,LPVOID *obj);
783 extern ULONG WINAPI IDirect3DBaseTexture8Impl_AddRef(LPDIRECT3DBASETEXTURE8 iface);
784 extern ULONG WINAPI IDirect3DBaseTexture8Impl_Release(LPDIRECT3DBASETEXTURE8 iface);
786 /* IDirect3DBaseTexture8: (Inherited from IDirect3DResource8) */
787 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_GetDevice(LPDIRECT3DBASETEXTURE8 iface, IDirect3DDevice8** ppDevice);
788 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_SetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
789 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_GetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
790 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_FreePrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid);
791 extern DWORD WINAPI IDirect3DBaseTexture8Impl_SetPriority(LPDIRECT3DBASETEXTURE8 iface, DWORD PriorityNew);
792 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetPriority(LPDIRECT3DBASETEXTURE8 iface);
793 extern void WINAPI IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8 iface);
794 extern D3DRESOURCETYPE WINAPI IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8 iface);
796 /* IDirect3DBaseTexture8: */
797 extern DWORD WINAPI IDirect3DBaseTexture8Impl_SetLOD(LPDIRECT3DBASETEXTURE8 iface, DWORD LODNew);
798 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetLOD(LPDIRECT3DBASETEXTURE8 iface);
799 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetLevelCount(LPDIRECT3DBASETEXTURE8 iface);
801 /* internal Interfaces */
802 extern BOOL WINAPI IDirect3DBaseTexture8Impl_IsDirty(LPDIRECT3DBASETEXTURE8 iface);
803 extern BOOL WINAPI IDirect3DBaseTexture8Impl_SetDirty(LPDIRECT3DBASETEXTURE8 iface, BOOL dirty);
806 /* --------------------- */
807 /* IDirect3DCubeTexture8 */
808 /* --------------------- */
810 /*****************************************************************************
811 * Predeclare the interface implementation structures
813 extern ICOM_VTABLE(IDirect3DCubeTexture8) Direct3DCubeTexture8_Vtbl;
815 /*****************************************************************************
816 * IDirect3DCubeTexture8 implementation structure
818 struct IDirect3DCubeTexture8Impl
820 /* IUnknown fields */
821 ICOM_VFIELD(IDirect3DCubeTexture8);
824 /* IDirect3DResource8 fields */
825 IDirect3DDevice8Impl *Device;
826 D3DRESOURCETYPE ResourceType;
828 /* IDirect3DBaseTexture8 fields */
833 /* IDirect3DCubeTexture8 fields */
837 IDirect3DSurface8Impl *surfaces[6][MAX_LEVELS];
841 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_QueryInterface(LPDIRECT3DCUBETEXTURE8 iface,REFIID refiid,LPVOID *obj);
842 extern ULONG WINAPI IDirect3DCubeTexture8Impl_AddRef(LPDIRECT3DCUBETEXTURE8 iface);
843 extern ULONG WINAPI IDirect3DCubeTexture8Impl_Release(LPDIRECT3DCUBETEXTURE8 iface);
845 /* IDirect3DCubeTexture8: (Inherited from IDirect3DResource8) */
846 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetDevice(LPDIRECT3DCUBETEXTURE8 iface, IDirect3DDevice8** ppDevice);
847 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
848 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
849 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_FreePrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid);
850 extern DWORD WINAPI IDirect3DCubeTexture8Impl_SetPriority(LPDIRECT3DCUBETEXTURE8 iface, DWORD PriorityNew);
851 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetPriority(LPDIRECT3DCUBETEXTURE8 iface);
852 extern void WINAPI IDirect3DCubeTexture8Impl_PreLoad(LPDIRECT3DCUBETEXTURE8 iface);
853 extern D3DRESOURCETYPE WINAPI IDirect3DCubeTexture8Impl_GetType(LPDIRECT3DCUBETEXTURE8 iface);
855 /* IDirect3DCubeTexture8: (Inherited from IDirect3DBaseTexture8) */
856 extern DWORD WINAPI IDirect3DCubeTexture8Impl_SetLOD(LPDIRECT3DCUBETEXTURE8 iface, DWORD LODNew);
857 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetLOD(LPDIRECT3DCUBETEXTURE8 iface);
858 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE8 iface);
860 /* IDirect3DCubeTexture8 */
861 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE8 iface, UINT Level, D3DSURFACE_DESC* pDesc);
862 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface8** ppCubeMapSurface);
863 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
864 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level);
865 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect);
868 /* ----------------- */
869 /* IDirect3DTexture8 */
870 /* ----------------- */
872 /*****************************************************************************
873 * Predeclare the interface implementation structures
875 extern ICOM_VTABLE(IDirect3DTexture8) Direct3DTexture8_Vtbl;
877 /*****************************************************************************
878 * IDirect3DTexture8 implementation structure
880 struct IDirect3DTexture8Impl
882 /* IUnknown fields */
883 ICOM_VFIELD(IDirect3DTexture8);
886 /* IDirect3DResourc8 fields */
887 IDirect3DDevice8Impl *Device;
888 D3DRESOURCETYPE ResourceType;
890 /* IDirect3DBaseTexture8 fields */
895 /* IDirect3DTexture8 fields */
900 IDirect3DSurface8Impl *surfaces[MAX_LEVELS];
904 extern HRESULT WINAPI IDirect3DTexture8Impl_QueryInterface(LPDIRECT3DTEXTURE8 iface,REFIID refiid,LPVOID *obj);
905 extern ULONG WINAPI IDirect3DTexture8Impl_AddRef(LPDIRECT3DTEXTURE8 iface);
906 extern ULONG WINAPI IDirect3DTexture8Impl_Release(LPDIRECT3DTEXTURE8 iface);
908 /* IDirect3DTexture8: (Inherited from IDirect3DResource8) */
909 extern HRESULT WINAPI IDirect3DTexture8Impl_GetDevice(LPDIRECT3DTEXTURE8 iface, IDirect3DDevice8** ppDevice);
910 extern HRESULT WINAPI IDirect3DTexture8Impl_SetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
911 extern HRESULT WINAPI IDirect3DTexture8Impl_GetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
912 extern HRESULT WINAPI IDirect3DTexture8Impl_FreePrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid);
913 extern DWORD WINAPI IDirect3DTexture8Impl_SetPriority(LPDIRECT3DTEXTURE8 iface, DWORD PriorityNew);
914 extern DWORD WINAPI IDirect3DTexture8Impl_GetPriority(LPDIRECT3DTEXTURE8 iface);
915 extern void WINAPI IDirect3DTexture8Impl_PreLoad(LPDIRECT3DTEXTURE8 iface);
916 extern D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(LPDIRECT3DTEXTURE8 iface);
918 /* IDirect3DTexture8: (Inherited from IDirect3DBaseTexture8) */
919 extern DWORD WINAPI IDirect3DTexture8Impl_SetLOD(LPDIRECT3DTEXTURE8 iface, DWORD LODNew);
920 extern DWORD WINAPI IDirect3DTexture8Impl_GetLOD(LPDIRECT3DTEXTURE8 iface);
921 extern DWORD WINAPI IDirect3DTexture8Impl_GetLevelCount(LPDIRECT3DTEXTURE8 iface);
923 /* IDirect3DTexture8: */
924 extern HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(LPDIRECT3DTEXTURE8 iface, UINT Level, D3DSURFACE_DESC* pDesc);
925 extern HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE8 iface, UINT Level, IDirect3DSurface8** ppSurfaceLevel);
926 extern HRESULT WINAPI IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
927 extern HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(LPDIRECT3DTEXTURE8 iface, UINT Level);
928 extern HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(LPDIRECT3DTEXTURE8 iface, CONST RECT* pDirtyRect);
931 /* ----------------------- */
932 /* IDirect3DVolumeTexture8 */
933 /* ----------------------- */
935 /*****************************************************************************
936 * Predeclare the interface implementation structures
938 extern ICOM_VTABLE(IDirect3DVolumeTexture8) Direct3DVolumeTexture8_Vtbl;
940 /*****************************************************************************
941 * IDirect3DVolumeTexture8 implementation structure
943 struct IDirect3DVolumeTexture8Impl
945 /* IUnknown fields */
946 ICOM_VFIELD(IDirect3DVolumeTexture8);
949 /* IDirect3DResource8 fields */
950 IDirect3DDevice8Impl *Device;
951 D3DRESOURCETYPE ResourceType;
953 /* IDirect3DBaseTexture8 fields */
958 /* IDirect3DVolumeTexture8 fields */
964 IDirect3DVolume8Impl *volumes[MAX_LEVELS];
968 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE8 iface,REFIID refiid,LPVOID *obj);
969 extern ULONG WINAPI IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8 iface);
970 extern ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8 iface);
972 /* IDirect3DVolumeTexture8: (Inherited from IDirect3DResource8) */
973 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE8 iface, IDirect3DDevice8** ppDevice);
974 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
975 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
976 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid);
977 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD PriorityNew);
978 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE8 iface);
979 extern void WINAPI IDirect3DVolumeTexture8Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE8 iface);
980 extern D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture8Impl_GetType(LPDIRECT3DVOLUMETEXTURE8 iface);
982 /* IDirect3DVolumeTexture8: (Inherited from IDirect3DBaseTexture8) */
983 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD LODNew);
984 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE8 iface);
985 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE8 iface);
987 /* IDirect3DVolumeTexture8: */
988 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DVOLUME_DESC *pDesc);
989 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, IDirect3DVolume8** ppVolumeLevel);
990 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
991 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level);
992 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE8 iface, CONST D3DBOX* pDirtyBox);
995 /* ==============================================================================
996 Private interfactes: beginning of cleaning/splitting for HAL and d3d9 support
997 ============================================================================== */
999 /* State Block for Begin/End/Capture/Create/Apply State Block */
1000 /* Note: Very long winded but I do not believe gl Lists will */
1001 /* resolve everything we need, so doing it manually for now */
1002 typedef struct SAVEDSTATES {
1003 BOOL lightEnable[MAX_ACTIVE_LIGHTS];
1005 BOOL lights[MAX_ACTIVE_LIGHTS];
1007 BOOL stream_source[MAX_STREAMS];
1009 BOOL transform[HIGHEST_TRANSFORMSTATE];
1012 BOOL vertexShaderConstant;
1013 BOOL vertexShaderDecl;
1015 BOOL pixelShaderConstant;
1016 BOOL renderstate[HIGHEST_RENDER_STATE];
1017 BOOL texture_state[8][HIGHEST_TEXTURE_STATE];
1018 BOOL clipplane[MAX_CLIPPLANES];
1022 /* ----------------------- */
1023 /* IDirect3DStateBlockImpl */
1024 /* ----------------------- */
1026 /*****************************************************************************
1027 * Predeclare the interface implementation structures
1029 /*extern ICOM_VTABLE(IDirect3DStateBlock9) Direct3DStateBlock9_Vtbl;*/
1031 /*****************************************************************************
1032 * IDirect3DStateBlock implementation structure
1034 struct IDirect3DStateBlockImpl {
1035 /* IUnknown fields */
1036 /*ICOM_VFIELD(IDirect3DStateBlock9);*/
1039 /* The device, to be replaced by a IDirect3DDeviceImpl */
1040 IDirect3DDevice8Impl* device;
1042 D3DSTATEBLOCKTYPE blockType;
1044 SAVEDSTATES Changed;
1048 BOOL lightEnable[MAX_ACTIVE_LIGHTS];
1051 double clipplane[MAX_CLIPPLANES][4];
1054 UINT stream_stride[MAX_STREAMS];
1055 IDirect3DVertexBuffer8 *stream_source[MAX_STREAMS];
1059 IDirect3DIndexBuffer8* pIndexData;
1060 UINT baseVertexIndex;
1063 IDirect3DBaseTexture8 *textures[8];
1064 int textureDimensions[8];
1065 /* Texture State Stage */
1066 DWORD texture_state[8][HIGHEST_TEXTURE_STATE];
1069 D3DLIGHT8 lights[MAX_ACTIVE_LIGHTS];
1072 D3DMATERIAL8 material;
1075 DWORD renderstate[HIGHEST_RENDER_STATE];
1078 D3DMATRIX transforms[HIGHEST_TRANSFORMSTATE];
1081 D3DVIEWPORT8 viewport;
1086 /* Vertex Shader Declaration */
1087 IDirect3DVertexShaderDeclarationImpl* vertexShaderDecl;
1092 /* Indexed Vertex Blending */
1093 D3DVERTEXBLENDFLAGS vertex_blend;
1096 /* Vertex Shader Constant */
1097 D3DSHADERVECTOR vertexShaderConstant[D3D8_VSHADER_MAX_CONSTANTS];
1098 /* Pixel Shader Constant */
1099 D3DSHADERVECTOR pixelShaderConstant[D3D8_PSHADER_MAX_CONSTANTS];
1102 /* exported Interfaces */
1103 /* internal Interfaces */
1104 /* temporary internal Interfaces */
1105 extern HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* This);
1106 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateStateBlock(IDirect3DDevice8Impl* This, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlockImpl** ppStateBlock);
1107 extern HRESULT WINAPI IDirect3DDeviceImpl_DeleteStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl* pSB);
1108 extern HRESULT WINAPI IDirect3DDeviceImpl_BeginStateBlock(IDirect3DDevice8Impl* This);
1109 extern HRESULT WINAPI IDirect3DDeviceImpl_EndStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl** ppStateBlock);
1110 extern HRESULT WINAPI IDirect3DDeviceImpl_ApplyStateBlock(IDirect3DDevice8Impl* iface, IDirect3DStateBlockImpl* pSB);
1111 extern HRESULT WINAPI IDirect3DDeviceImpl_CaptureStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl* pSB);
1113 /* ------------------------------------ */
1114 /* IDirect3DVertexShaderDeclarationImpl */
1115 /* ------------------------------------ */
1117 /*****************************************************************************
1118 * Predeclare the interface implementation structures
1120 /*extern ICOM_VTABLE(IDirect3DVertexShaderDeclaration9) Direct3DVertexShaderDeclaration9_Vtbl;*/
1122 /*****************************************************************************
1123 * IDirect3DVertexShaderDeclaration implementation structure
1125 struct IDirect3DVertexShaderDeclarationImpl {
1126 /* IUnknown fields */
1127 /*ICOM_VFIELD(IDirect3DVertexShaderDeclaration9);*/
1130 /* The device, to be replaced by a IDirect3DDeviceImpl */
1131 IDirect3DDevice8Impl* device;
1133 /** precomputed fvf if simple declaration */
1134 DWORD fvf[MAX_STREAMS];
1137 /** dx8 compatible Declaration fields */
1138 DWORD* pDeclaration8;
1139 DWORD declaration8Length;
1142 /* exported Interfaces */
1143 extern HRESULT WINAPI IDirect3DVertexShaderDeclarationImpl_GetDeclaration8(IDirect3DVertexShaderDeclarationImpl* This, DWORD* pData, UINT* pSizeOfData);
1144 /*extern HRESULT IDirect3DVertexShaderDeclarationImpl_GetDeclaration9(IDirect3DVertexShaderDeclarationImpl* This, D3DVERTEXELEMENT9* pData, UINT* pNumElements);*/
1145 /* internal Interfaces */
1146 /* temporary internal Interfaces */
1147 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateVertexShaderDeclaration8(IDirect3DDevice8Impl* This, CONST DWORD* pDeclaration8, IDirect3DVertexShaderDeclarationImpl** ppVertexShaderDecl);
1150 /* ------------------------- */
1151 /* IDirect3DVertexShaderImpl */
1152 /* ------------------------- */
1154 /*****************************************************************************
1155 * Predeclare the interface implementation structures
1157 /*extern ICOM_VTABLE(IDirect3DVertexShader9) Direct3DVertexShader9_Vtbl;*/
1159 /*****************************************************************************
1160 * IDirect3DVertexShader implementation structure
1162 struct IDirect3DVertexShaderImpl {
1163 /*ICOM_VFIELD(IDirect3DVertexShader9);*/
1166 /* The device, to be replaced by a IDirect3DDeviceImpl */
1167 IDirect3DDevice8Impl* device;
1170 UINT functionLength;
1171 DWORD usage; /* 0 || D3DUSAGE_SOFTWAREPROCESSING */
1173 /* run time datas */
1175 VSHADERINPUTDATA8 input;
1176 VSHADEROUTPUTDATA8 output;
1179 /* exported Interfaces */
1180 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetFunction(IDirect3DVertexShaderImpl* This, VOID* pData, UINT* pSizeOfData);
1181 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);*/
1182 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST INT* pConstantData, UINT Vector4iCount);*/
1183 extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount);
1184 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);*/
1185 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, INT* pConstantData, UINT Vector4iCount);*/
1186 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, FLOAT* pConstantData, UINT Vector4fCount);
1187 /* internal Interfaces */
1188 extern DWORD WINAPI IDirect3DVertexShaderImpl_GetVersion(IDirect3DVertexShaderImpl* This);
1189 extern HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* This, VSHADERINPUTDATA8* input, VSHADEROUTPUTDATA8* output);
1190 /* temporary internal Interfaces */
1191 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateVertexShader(IDirect3DDevice8Impl* This, CONST DWORD* pFunction, DWORD Usage, IDirect3DVertexShaderImpl** ppVertexShader);
1192 extern HRESULT WINAPI IDirect3DDeviceImpl_FillVertexShaderInput(IDirect3DDevice8Impl* This, IDirect3DVertexShaderImpl* vshader, DWORD SkipnStrides);
1194 /* ------------------------ */
1195 /* IDirect3DPixelShaderImpl */
1196 /* ------------------------ */
1198 /*****************************************************************************
1199 * Predeclare the interface implementation structures
1201 /*extern ICOM_VTABLE(IDirect3DPixelShader9) Direct3DPixelShader9_Vtbl;*/
1203 /*****************************************************************************
1204 * IDirect3DPixelShader implementation structure
1206 struct IDirect3DPixelShaderImpl {
1207 /*ICOM_VFIELD(IDirect3DPixelShader9);*/
1210 /* The device, to be replaced by a IDirect3DDeviceImpl */
1211 IDirect3DDevice8Impl* device;
1214 UINT functionLength;
1216 /* run time datas */
1218 PSHADERINPUTDATA8 input;
1219 PSHADEROUTPUTDATA8 output;
1222 /* exported Interfaces */
1223 extern HRESULT WINAPI IDirect3DPixelShaderImpl_GetFunction(IDirect3DPixelShaderImpl* This, VOID* pData, UINT* pSizeOfData);
1224 /* internal Interfaces */
1225 extern DWORD WINAPI IDirect3DPixelShaderImpl_GetVersion(IDirect3DPixelShaderImpl* This);
1226 /* temporary internal Interfaces */
1227 extern HRESULT WINAPI IDirect3DDeviceImpl_CreatePixelShader(IDirect3DDevice8Impl* This, CONST DWORD* pFunction, IDirect3DPixelShaderImpl** ppPixelShader);
1231 * Internals functions
1233 * to see how not defined it here
1235 void GetSrcAndOpFromValue(DWORD iValue, BOOL isAlphaArg, GLenum* source, GLenum* operand);
1236 void setupTextureStates(LPDIRECT3DDEVICE8 iface, DWORD Stage);
1237 void set_tex_op(LPDIRECT3DDEVICE8 iface, BOOL isAlpha, int Stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3);
1239 SHORT D3DFmtGetBpp(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1240 GLint D3DFmt2GLIntFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1241 GLenum D3DFmt2GLFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1242 GLenum D3DFmt2GLType(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1244 GLenum D3DFmt2GLDepthFmt(D3DFORMAT fmt);
1245 GLenum D3DFmt2GLDepthType(D3DFORMAT fmt);
1247 int D3DPrimitiveListGetVertexSize(D3DPRIMITIVETYPE PrimitiveType, int iNumPrim);
1248 int D3DPrimitive2GLenum(D3DPRIMITIVETYPE PrimitiveType);
1249 int D3DFVFGetSize(D3DFORMAT fvf);
1251 int SOURCEx_RGB_EXT(DWORD arg);
1252 int OPERANDx_RGB_EXT(DWORD arg);
1253 int SOURCEx_ALPHA_EXT(DWORD arg);
1254 int OPERANDx_ALPHA_EXT(DWORD arg);
1255 GLenum StencilOp(DWORD op);
1258 * Internals debug functions
1260 const char* debug_d3ddevicetype(D3DDEVTYPE devtype);
1261 const char* debug_d3dusage(DWORD usage);
1262 const char* debug_d3dformat(D3DFORMAT fmt);
1263 const char* debug_d3dressourcetype(D3DRESOURCETYPE res);
1264 const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType);
1265 const char* debug_d3dpool(D3DPOOL Pool);
1266 const char *debug_d3drenderstate(DWORD State);
1267 const char *debug_d3dtexturestate(DWORD State);
1269 /* Some #defines for additional diagnostics */
1270 #if 0 /* NOTE: Must be 0 in cvs */
1271 /* To avoid having to get gigabytes of trace, the following can be compiled in, and at the start
1272 of each frame, a check is made for the existence of C:\D3DTRACE, and if if exists d3d trace
1273 is enabled, and if it doesnt exists it is disabled. */
1274 # define FRAME_DEBUGGING
1275 /* Adding in the SINGLE_FRAME_DEBUGGING gives a trace of just what makes up a single frame, before
1276 the file is deleted */
1277 # if 1 /* NOTE: Must be 1 in cvs, as this is mostly more useful than a trace from program start */
1278 # define SINGLE_FRAME_DEBUGGING
1280 /* The following, when enabled, lets you see the makeup of the frame, by drawprimitive calls.
1281 It can only be enabled when FRAME_DEBUGGING is also enabled
1282 The contents of the back buffer are written into /tmp/backbuffer_* after each primitive
1284 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
1285 # define SHOW_FRAME_MAKEUP 1
1287 /* The following, when enabled, lets you see the makeup of the all the textures used during each
1288 of the drawprimitive calls. It can only be enabled when SHOW_FRAME_MAKEUP is also enabled.
1289 The contents of the textures assigned to each stage are written into
1290 /tmp/texture_*_<Stage>.ppm after each primitive array is drawn. */
1291 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
1292 # define SHOW_TEXTURE_MAKEUP 0
1295 extern BOOL isDumpingFrames;
1296 extern LONG primCounter;
1299 /* Per-vertex trace: */
1300 #if 0 /* NOTE: Must be 0 in cvs */
1301 # define VTRACE(A) TRACE A
1306 #define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w);
1307 #define TRACE_STRIDED(sd,name) TRACE( #name "=(data:%p, stride:%ld, type:%ld)\n", sd->u.s.name.lpData, sd->u.s.name.dwStride, sd->u.s.name.dwType);
1309 #endif /* __WINE_D3DX8_PRIVATE_H */