2 * Direct3D 8 private include file
4 * Copyright 2002-2004 Jason Edmeades
5 * Copyright 2003-2004 Raphael Junqueira
6 * Copyright 2004 Christian Costa
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef __WINE_D3D8_PRIVATE_H
24 #define __WINE_D3D8_PRIVATE_H
26 #ifndef __WINE_CONFIG_H
27 # error You must include config.h to use this header
30 /* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES */
31 #define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */
33 #define GLX_GLXEXT_PROTOTYPES
35 #ifdef HAVE_GL_GLEXT_H
36 # include <GL/glext.h>
44 /* Redefines the constants */
45 #define CALLBACK __stdcall
46 #define WINAPI __stdcall
47 #define APIENTRY WINAPI
51 extern void (*wine_tsx11_lock_ptr)(void);
52 extern void (*wine_tsx11_unlock_ptr)(void);
54 /* As GLX relies on X, this is needed */
57 #define ENTER_GL() ++num_lock; TRACE("inc lock to: %d\n", num_lock); wine_tsx11_lock_ptr()
58 #define LEAVE_GL() if (num_lock > 2) TRACE("fucking locks: %d\n", num_lock); --num_lock; wine_tsx11_unlock_ptr()
60 #define ENTER_GL() wine_tsx11_lock_ptr()
61 #define LEAVE_GL() wine_tsx11_unlock_ptr()
69 #include "wine/wined3d_interface.h"
81 #define MAX_PALETTES 256
82 #define MAX_STREAMS 16
83 #define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
84 #define MAX_LEVELS 256
86 /* Other useful values */
87 #define HIGHEST_RENDER_STATE 174
88 #define HIGHEST_TEXTURE_STATE 29
89 #define HIGHEST_TRANSFORMSTATE 512
90 #define D3DSBT_RECORDED 0xfffffffe
92 /* Performance changes - Only reapply what is necessary */
93 #define REAPPLY_ALPHAOP 0x0001
94 #define REAPPLY_ALL 0xFFFF
96 /* CreateVertexShader can return > 0xFFFF */
97 #define VS_HIGHESTFIXEDFXF 0xF0000000
98 #define VERTEX_SHADER(Handle) \
99 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(VertexShaders) / sizeof(IDirect3DVertexShaderImpl*)) ? NULL : VertexShaders[Handle]) : VertexShaders[Handle - VS_HIGHESTFIXEDFXF])
100 #define VERTEX_SHADER_DECL(Handle) \
101 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(VertexShaderDeclarations) / sizeof(IDirect3DVertexShaderDeclarationImpl*)) ? NULL : VertexShaderDeclarations[Handle]) : VertexShaderDeclarations[Handle - VS_HIGHESTFIXEDFXF])
102 #define PIXEL_SHADER(Handle) \
103 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(PixelShaders) / sizeof(IDirect3DPixelShaderImpl*)) ? NULL : PixelShaders[Handle]) : PixelShaders[Handle - VS_HIGHESTFIXEDFXF])
105 /* Direct3D8 Interfaces: */
106 typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
107 typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
108 typedef struct IDirect3D8Impl IDirect3D8Impl;
109 typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
110 typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
111 typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
112 typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
113 typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
114 typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
115 typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
116 typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
117 typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
119 /** Private Interfaces: */
120 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
121 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
122 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
123 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
125 typedef struct D3DSHADERVECTOR {
132 typedef struct D3DSHADERSCALAR {
136 #define D3D8_VSHADER_MAX_CONSTANTS 96
137 typedef D3DSHADERVECTOR VSHADERCONSTANTS8[D3D8_VSHADER_MAX_CONSTANTS];
139 typedef struct VSHADERDATA8 {
140 /** Run Time Shader Function Constants */
141 /*D3DXBUFFER* constants;*/
143 /** Shader Code as char ... */
148 /** temporary here waiting for buffer code */
149 typedef struct VSHADERINPUTDATA8 {
150 D3DSHADERVECTOR V[17];
153 /** temporary here waiting for buffer code */
154 typedef struct VSHADEROUTPUTDATA8 {
155 D3DSHADERVECTOR oPos;
156 D3DSHADERVECTOR oD[2];
157 D3DSHADERVECTOR oT[8];
158 D3DSHADERVECTOR oFog;
159 D3DSHADERVECTOR oPts;
160 } VSHADEROUTPUTDATA8;
163 #define D3D8_PSHADER_MAX_CONSTANTS 32
164 typedef D3DSHADERVECTOR PSHADERCONSTANTS8[D3D8_PSHADER_MAX_CONSTANTS];
166 typedef struct PSHADERDATA8 {
167 /** Run Time Shader Function Constants */
168 /*D3DXBUFFER* constants;*/
170 /** Shader Code as char ... */
175 /** temporary here waiting for buffer code */
176 typedef struct PSHADERINPUTDATA8 {
177 D3DSHADERVECTOR V[2];
178 D3DSHADERVECTOR T[8];
179 D3DSHADERVECTOR S[16];
180 /*D3DSHADERVECTOR R[12];*/
183 /** temporary here waiting for buffer code */
184 typedef struct PSHADEROUTPUTDATA8 {
185 D3DSHADERVECTOR oC[4];
186 D3DSHADERVECTOR oDepth;
187 } PSHADEROUTPUTDATA8;
190 * Private definitions for internal use only
192 typedef struct PLIGHTINFOEL PLIGHTINFOEL;
193 struct PLIGHTINFOEL {
194 D3DLIGHT8 OriginalParms;
201 /* Converted parms to speed up swapping lights */
214 #define checkGLcall(A) \
216 GLint err = glGetError(); \
217 if (err != GL_NO_ERROR) { \
218 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
220 TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \
223 #define vcheckGLcall(A) \
225 GLint err = glGetError(); \
226 if (err != GL_NO_ERROR) { \
227 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
229 VTRACE(("%s call ok %s / %d\n", A, __FILE__, __LINE__)); \
233 #include "d3dcore_gl.h"
236 #define GL_LIMITS(ExtName) (This->direct3d8->gl_info.max_##ExtName)
237 #define GL_SUPPORT(ExtName) (TRUE == This->direct3d8->gl_info.supported[ExtName])
238 #define GL_SUPPORT_DEV(ExtName, dev) (TRUE == (dev)->direct3d8->gl_info.supported[ExtName])
239 #define GL_EXTCALL(FuncName) (This->direct3d8->gl_info.FuncName)
240 #define GL_EXTCALL_DEV(FuncName, dev) ((dev)->direct3d8->gl_info.FuncName)
243 #define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f)
244 #define D3DCOLOR_G(dw) (((float) (((dw) >> 8) & 0xFF)) / 255.0f)
245 #define D3DCOLOR_B(dw) (((float) (((dw) >> 0) & 0xFF)) / 255.0f)
246 #define D3DCOLOR_A(dw) (((float) (((dw) >> 24) & 0xFF)) / 255.0f)
248 #define D3DCOLORTOCOLORVALUE(dw, col) \
249 (col).r = D3DCOLOR_R(dw); \
250 (col).g = D3DCOLOR_G(dw); \
251 (col).b = D3DCOLOR_B(dw); \
252 (col).a = D3DCOLOR_A(dw);
254 #define D3DCOLORTOVECTOR4(dw, vec) \
255 (vec).x = D3DCOLOR_R(dw); \
256 (vec).y = D3DCOLOR_G(dw); \
257 (vec).z = D3DCOLOR_B(dw); \
258 (vec).w = D3DCOLOR_A(dw);
260 #define D3DCOLORTOGLFLOAT4(dw, vec) \
261 (vec)[0] = D3DCOLOR_R(dw); \
262 (vec)[1] = D3DCOLOR_G(dw); \
263 (vec)[2] = D3DCOLOR_B(dw); \
264 (vec)[3] = D3DCOLOR_A(dw);
266 /* ===========================================================================
267 The interfactes themselves
268 =========================================================================== */
274 /*****************************************************************************
275 * Predeclare the interface implementation structures
277 extern IDirect3D8Vtbl Direct3D8_Vtbl;
279 /*****************************************************************************
280 * IDirect3D implementation structure
282 struct IDirect3D8Impl
284 /* IUnknown fields */
285 IDirect3D8Vtbl *lpVtbl;
288 /* The WineD3D device */
291 /* IDirect3D8 fields */
294 IDirect3D8Impl *direct3d8;
298 extern HRESULT WINAPI IDirect3D8Impl_QueryInterface(LPDIRECT3D8 iface,REFIID refiid,LPVOID *obj);
299 extern ULONG WINAPI IDirect3D8Impl_AddRef(LPDIRECT3D8 iface);
300 extern ULONG WINAPI IDirect3D8Impl_Release(LPDIRECT3D8 iface);
303 extern HRESULT WINAPI IDirect3D8Impl_RegisterSoftwareDevice(LPDIRECT3D8 iface, void* pInitializeFunction);
304 extern UINT WINAPI IDirect3D8Impl_GetAdapterCount(LPDIRECT3D8 iface);
305 extern HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier(LPDIRECT3D8 iface, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER8* pIdentifier);
306 extern UINT WINAPI IDirect3D8Impl_GetAdapterModeCount(LPDIRECT3D8 iface, UINT Adapter);
307 extern HRESULT WINAPI IDirect3D8Impl_EnumAdapterModes(LPDIRECT3D8 iface, UINT Adapter, UINT Mode, D3DDISPLAYMODE* pMode);
308 extern HRESULT WINAPI IDirect3D8Impl_GetAdapterDisplayMode(LPDIRECT3D8 iface, UINT Adapter, D3DDISPLAYMODE* pMode);
309 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceType(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat,
310 D3DFORMAT BackBufferFormat, BOOL Windowed);
311 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
312 DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
313 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceMultiSampleType(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat,
314 BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType);
315 extern HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
316 D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
317 extern HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps);
318 extern HMONITOR WINAPI IDirect3D8Impl_GetAdapterMonitor(LPDIRECT3D8 iface, UINT Adapter);
319 extern HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
320 DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
321 IDirect3DDevice8** ppReturnedDeviceInterface);
323 /* ---------------- */
324 /* IDirect3DDevice8 */
325 /* ---------------- */
327 /*****************************************************************************
328 * Predeclare the interface implementation structures
330 extern IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl;
332 /*****************************************************************************
333 * IDirect3DDevice8 implementation structure
335 struct IDirect3DDevice8Impl
337 /* IUnknown fields */
338 IDirect3DDevice8Vtbl *lpVtbl;
341 /* IDirect3DDevice8 fields */
342 IDirect3D8Impl *direct3d8;
343 IWineD3DDevice *WineD3DDevice;
345 IDirect3DSurface8Impl *frontBuffer;
346 IDirect3DSurface8Impl *backBuffer;
347 IDirect3DSurface8Impl *depthStencilBuffer;
349 IDirect3DSurface8Impl *renderTarget;
350 IDirect3DSurface8Impl *stencilBufferTarget;
352 D3DPRESENT_PARAMETERS PresentParms;
353 D3DDEVICE_CREATION_PARAMETERS CreateParms;
363 /* State block related */
364 BOOL isRecordingState;
365 IDirect3DStateBlockImpl *StateBlock;
366 IDirect3DStateBlockImpl *UpdateStateBlock;
368 /* palettes texture management */
369 PALETTEENTRY palettes[MAX_PALETTES][256];
372 BOOL texture_shader_active;
375 BOOL modelview_valid;
377 BOOL view_ident; /* true iff view matrix is identity */
378 BOOL last_was_rhw; /* true iff last draw_primitive was in xyzrhw mode */
379 GLenum tracking_parm; /* Which source is tracking current colour */
380 LONG tracking_color; /* used iff GL_COLOR_MATERIAL was enabled */
381 #define DISABLED_TRACKING 0 /* Disabled */
382 #define IS_TRACKING 1 /* tracking_parm is tracking diffuse color */
383 #define NEEDS_TRACKING 2 /* Tracking needs to be enabled when needed */
384 #define NEEDS_DISABLE 3 /* Tracking needs to be disabled when needed*/
388 XVisualInfo *visInfo;
392 GLXContext render_ctx;
394 GLint maxConcurrentLights;
396 /* OpenGL Extension related */
398 /* Cursor management */
406 UINT dummyTextureName[8];
408 /* For rendering to a texture using glCopyTexImage */
409 BOOL renderUpsideDown;
413 extern HRESULT WINAPI IDirect3DDevice8Impl_QueryInterface(LPDIRECT3DDEVICE8 iface, REFIID refiid, LPVOID *obj);
414 extern ULONG WINAPI IDirect3DDevice8Impl_AddRef(LPDIRECT3DDEVICE8 iface);
415 extern ULONG WINAPI IDirect3DDevice8Impl_Release(LPDIRECT3DDEVICE8 iface);
417 /* IDirect3DDevice8: */
418 extern HRESULT WINAPI IDirect3DDevice8Impl_TestCooperativeLevel(LPDIRECT3DDEVICE8 iface);
419 extern UINT WINAPI IDirect3DDevice8Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE8 iface);
420 extern HRESULT WINAPI IDirect3DDevice8Impl_ResourceManagerDiscardBytes(LPDIRECT3DDEVICE8 iface, DWORD Bytes);
421 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDirect3D(LPDIRECT3DDEVICE8 iface, IDirect3D8** ppD3D8);
422 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDeviceCaps(LPDIRECT3DDEVICE8 iface, D3DCAPS8* pCaps);
423 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDisplayMode(LPDIRECT3DDEVICE8 iface, D3DDISPLAYMODE* pMode);
424 extern HRESULT WINAPI IDirect3DDevice8Impl_GetCreationParameters(LPDIRECT3DDEVICE8 iface, D3DDEVICE_CREATION_PARAMETERS* pParameters);
425 extern HRESULT WINAPI IDirect3DDevice8Impl_SetCursorProperties(LPDIRECT3DDEVICE8 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8* pCursorBitmap);
426 extern void WINAPI IDirect3DDevice8Impl_SetCursorPosition(LPDIRECT3DDEVICE8 iface, UINT XScreenSpace, UINT YScreenSpace, DWORD Flags);
427 extern BOOL WINAPI IDirect3DDevice8Impl_ShowCursor(LPDIRECT3DDEVICE8 iface, BOOL bShow);
428 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain8** pSwapChain);
429 extern HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters);
430 extern HRESULT WINAPI IDirect3DDevice8Impl_Present(LPDIRECT3DDEVICE8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
431 extern HRESULT WINAPI IDirect3DDevice8Impl_GetBackBuffer(LPDIRECT3DDEVICE8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer);
432 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRasterStatus(LPDIRECT3DDEVICE8 iface, D3DRASTER_STATUS* pRasterStatus);
433 extern void WINAPI IDirect3DDevice8Impl_SetGammaRamp(LPDIRECT3DDEVICE8 iface, DWORD Flags, CONST D3DGAMMARAMP* pRamp);
434 extern void WINAPI IDirect3DDevice8Impl_GetGammaRamp(LPDIRECT3DDEVICE8 iface, D3DGAMMARAMP* pRamp);
435 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture8** ppTexture);
436 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture);
437 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture);
438 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer8** ppVertexBuffer);
439 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer8** ppIndexBuffer);
440 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateRenderTarget(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, BOOL Lockable, IDirect3DSurface8** ppSurface);
441 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, IDirect3DSurface8** ppSurface);
442 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateImageSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, IDirect3DSurface8** ppSurface);
443 extern HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, IDirect3DSurface8* pDestinationSurface, CONST POINT* pDestPointsArray);
444 extern HRESULT WINAPI IDirect3DDevice8Impl_UpdateTexture(LPDIRECT3DDEVICE8 iface, IDirect3DBaseTexture8* pSourceTexture, IDirect3DBaseTexture8* pDestinationTexture);
445 extern HRESULT WINAPI IDirect3DDevice8Impl_GetFrontBuffer(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pDestSurface);
446 extern HRESULT WINAPI IDirect3DDevice8Impl_SetRenderTarget(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pRenderTarget, IDirect3DSurface8* pNewZStencil);
447 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRenderTarget(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8** ppRenderTarget);
448 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8** ppZStencilSurface);
449 extern HRESULT WINAPI IDirect3DDevice8Impl_BeginScene(LPDIRECT3DDEVICE8 iface);
450 extern HRESULT WINAPI IDirect3DDevice8Impl_EndScene(LPDIRECT3DDEVICE8 iface);
451 extern HRESULT WINAPI IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil);
452 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
453 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
454 extern HRESULT WINAPI IDirect3DDevice8Impl_MultiplyTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
455 extern HRESULT WINAPI IDirect3DDevice8Impl_SetViewport(LPDIRECT3DDEVICE8 iface, CONST D3DVIEWPORT8* pViewport);
456 extern HRESULT WINAPI IDirect3DDevice8Impl_GetViewport(LPDIRECT3DDEVICE8 iface, D3DVIEWPORT8* pViewport);
457 extern HRESULT WINAPI IDirect3DDevice8Impl_SetMaterial(LPDIRECT3DDEVICE8 iface, CONST D3DMATERIAL8* pMaterial);
458 extern HRESULT WINAPI IDirect3DDevice8Impl_GetMaterial(LPDIRECT3DDEVICE8 iface, D3DMATERIAL8* pMaterial);
459 extern HRESULT WINAPI IDirect3DDevice8Impl_SetLight(LPDIRECT3DDEVICE8 iface, DWORD Index, CONST D3DLIGHT8* pLight);
460 extern HRESULT WINAPI IDirect3DDevice8Impl_GetLight(LPDIRECT3DDEVICE8 iface, DWORD Index, D3DLIGHT8* pLight);
461 extern HRESULT WINAPI IDirect3DDevice8Impl_LightEnable(LPDIRECT3DDEVICE8 iface, DWORD Index, BOOL Enable);
462 extern HRESULT WINAPI IDirect3DDevice8Impl_GetLightEnable(LPDIRECT3DDEVICE8 iface, DWORD Index, BOOL* pEnable);
463 extern HRESULT WINAPI IDirect3DDevice8Impl_SetClipPlane(LPDIRECT3DDEVICE8 iface, DWORD Index, CONST float* pPlane);
464 extern HRESULT WINAPI IDirect3DDevice8Impl_GetClipPlane(LPDIRECT3DDEVICE8 iface, DWORD Index, float* pPlane);
465 extern HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3DRENDERSTATETYPE State, DWORD Value);
466 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRenderState(LPDIRECT3DDEVICE8 iface, D3DRENDERSTATETYPE State, DWORD* pValue);
467 extern HRESULT WINAPI IDirect3DDevice8Impl_BeginStateBlock(LPDIRECT3DDEVICE8 iface);
468 extern HRESULT WINAPI IDirect3DDevice8Impl_EndStateBlock(LPDIRECT3DDEVICE8 iface, DWORD* pToken);
469 extern HRESULT WINAPI IDirect3DDevice8Impl_ApplyStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
470 extern HRESULT WINAPI IDirect3DDevice8Impl_CaptureStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
471 extern HRESULT WINAPI IDirect3DDevice8Impl_DeleteStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
472 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(LPDIRECT3DDEVICE8 iface, D3DSTATEBLOCKTYPE Type,DWORD* pToken);
473 extern HRESULT WINAPI IDirect3DDevice8Impl_SetClipStatus(LPDIRECT3DDEVICE8 iface, CONST D3DCLIPSTATUS8* pClipStatus);
474 extern HRESULT WINAPI IDirect3DDevice8Impl_GetClipStatus(LPDIRECT3DDEVICE8 iface, D3DCLIPSTATUS8* pClipStatus);
475 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage, IDirect3DBaseTexture8** ppTexture);
476 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage, IDirect3DBaseTexture8* pTexture);
477 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue);
478 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
479 extern HRESULT WINAPI IDirect3DDevice8Impl_ValidateDevice(LPDIRECT3DDEVICE8 iface, DWORD* pNumPasses);
480 extern HRESULT WINAPI IDirect3DDevice8Impl_GetInfo(LPDIRECT3DDEVICE8 iface, DWORD DevInfoID, void* pDevInfoStruct, DWORD DevInfoStructSize);
481 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPaletteEntries(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries);
482 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPaletteEntries(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber, PALETTEENTRY* pEntries);
483 extern HRESULT WINAPI IDirect3DDevice8Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber);
484 extern HRESULT WINAPI IDirect3DDevice8Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface, UINT *PaletteNumber);
485 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
486 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount);
487 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
488 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);
489 extern HRESULT WINAPI IDirect3DDevice8Impl_ProcessVertices(LPDIRECT3DDEVICE8 iface, UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags);
490 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage);
491 extern HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
492 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD* pHandle);
493 extern HRESULT WINAPI IDirect3DDevice8Impl_DeleteVertexShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
494 extern HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,CONST void* pConstantData,DWORD ConstantCount);
495 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,void* pConstantData,DWORD ConstantCount);
496 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderDeclaration(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
497 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
498 extern HRESULT WINAPI IDirect3DDevice8Impl_SetStreamSource(LPDIRECT3DDEVICE8 iface, UINT StreamNumber,IDirect3DVertexBuffer8* pStreamData,UINT Stride);
499 extern HRESULT WINAPI IDirect3DDevice8Impl_GetStreamSource(LPDIRECT3DDEVICE8 iface, UINT StreamNumber,IDirect3DVertexBuffer8** ppStreamData,UINT* pStride);
500 extern HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex);
501 extern HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex);
502 extern HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pFunction,DWORD* pHandle);
503 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
504 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD* pHandle);
505 extern HRESULT WINAPI IDirect3DDevice8Impl_DeletePixelShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
506 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,CONST void* pConstantData,DWORD ConstantCount);
507 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,void* pConstantData,DWORD ConstantCount);
508 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
509 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawRectPatch(LPDIRECT3DDEVICE8 iface, UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo);
510 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawTriPatch(LPDIRECT3DDEVICE8 iface, UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo);
511 extern HRESULT WINAPI IDirect3DDevice8Impl_DeletePatch(LPDIRECT3DDEVICE8 iface, UINT Handle);
513 /* internal Interfaces */
514 extern HRESULT WINAPI IDirect3DDevice8Impl_CleanRender(LPDIRECT3DDEVICE8 iface);
515 extern HRESULT WINAPI IDirect3DDevice8Impl_ActiveRender(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* RenderSurface, IDirect3DSurface8* StencilSurface);
518 /* ---------------- */
519 /* IDirect3DVolume8 */
520 /* ---------------- */
522 /*****************************************************************************
523 * Predeclare the interface implementation structures
525 extern IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl;
527 /*****************************************************************************
528 * IDirect3DVolume8 implementation structure
530 struct IDirect3DVolume8Impl
532 /* IUnknown fields */
533 IDirect3DVolume8Vtbl *lpVtbl;
536 /* IDirect3DVolume8 fields */
537 IDirect3DDevice8Impl *Device;
538 D3DRESOURCETYPE ResourceType;
541 D3DVOLUME_DESC myDesc;
542 BYTE *allocatedMemory;
554 extern HRESULT WINAPI IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 iface,REFIID refiid,LPVOID *obj);
555 extern ULONG WINAPI IDirect3DVolume8Impl_AddRef(LPDIRECT3DVOLUME8 iface);
556 extern ULONG WINAPI IDirect3DVolume8Impl_Release(LPDIRECT3DVOLUME8 iface);
558 /* IDirect3DVolume8: */
559 extern HRESULT WINAPI IDirect3DVolume8Impl_GetDevice(LPDIRECT3DVOLUME8 iface, IDirect3DDevice8** ppDevice);
560 extern HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
561 extern HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
562 extern HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid);
563 extern HRESULT WINAPI IDirect3DVolume8Impl_GetContainer(LPDIRECT3DVOLUME8 iface, REFIID riid, void** ppContainer);
564 extern HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface, D3DVOLUME_DESC* pDesc);
565 extern HRESULT WINAPI IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
566 extern HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface);
568 /* internal Interfaces */
569 extern HRESULT WINAPI IDirect3DVolume8Impl_CleanDirtyBox(LPDIRECT3DVOLUME8 iface);
570 extern HRESULT WINAPI IDirect3DVolume8Impl_AddDirtyBox(LPDIRECT3DVOLUME8 iface, CONST D3DBOX* pDirtyBox);
572 /* ------------------- */
573 /* IDirect3DSwapChain8 */
574 /* ------------------- */
576 /*****************************************************************************
577 * Predeclare the interface implementation structures
579 extern IDirect3DSwapChain8Vtbl Direct3DSwapChain8_Vtbl;
581 /*****************************************************************************
582 * IDirect3DSwapChain8 implementation structure
584 struct IDirect3DSwapChain8Impl
586 /* IUnknown fields */
587 IDirect3DSwapChain8Vtbl *lpVtbl;
590 /* IDirect3DSwapChain8 fields */
591 IDirect3DSurface8Impl *frontBuffer;
592 IDirect3DSurface8Impl *backBuffer;
593 IDirect3DSurface8Impl *depthStencilBuffer;
594 D3DPRESENT_PARAMETERS PresentParms;
596 /* OpenGL/GLX related */
598 Drawable swap_drawable;
602 extern HRESULT WINAPI IDirect3DSwapChain8Impl_QueryInterface(LPDIRECT3DSWAPCHAIN8 iface, REFIID refiid, LPVOID *obj);
603 extern ULONG WINAPI IDirect3DSwapChain8Impl_AddRef(LPDIRECT3DSWAPCHAIN8 iface);
604 extern ULONG WINAPI IDirect3DSwapChain8Impl_Release(LPDIRECT3DSWAPCHAIN8 iface);
606 /* IDirect3DSwapChain8: */
607 extern HRESULT WINAPI IDirect3DSwapChain8Impl_Present(LPDIRECT3DSWAPCHAIN8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion);
608 extern HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer);
611 /* ----------------- */
612 /* IDirect3DSurface8 */
613 /* ----------------- */
615 /*****************************************************************************
616 * Predeclare the interface implementation structures
618 extern IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl;
620 /*****************************************************************************
621 * IDirect3DSurface8 implementation structure
623 struct IDirect3DSurface8Impl
625 /* IUnknown fields */
626 IDirect3DSurface8Vtbl *lpVtbl;
629 /* IDirect3DSurface8 fields */
630 IDirect3DDevice8Impl *Device;
631 D3DRESOURCETYPE ResourceType;
634 D3DSURFACE_DESC myDesc;
635 BYTE *allocatedMemory;
649 extern HRESULT WINAPI IDirect3DSurface8Impl_QueryInterface(LPDIRECT3DSURFACE8 iface,REFIID refiid,LPVOID *obj);
650 extern ULONG WINAPI IDirect3DSurface8Impl_AddRef(LPDIRECT3DSURFACE8 iface);
651 extern ULONG WINAPI IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface);
653 /* IDirect3DSurface8: */
654 extern HRESULT WINAPI IDirect3DSurface8Impl_GetDevice(LPDIRECT3DSURFACE8 iface, IDirect3DDevice8** ppDevice);
655 extern HRESULT WINAPI IDirect3DSurface8Impl_SetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags);
656 extern HRESULT WINAPI IDirect3DSurface8Impl_GetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,void* pData,DWORD* pSizeOfData);
657 extern HRESULT WINAPI IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid);
658 extern HRESULT WINAPI IDirect3DSurface8Impl_GetContainer(LPDIRECT3DSURFACE8 iface, REFIID riid,void** ppContainer);
659 extern HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(LPDIRECT3DSURFACE8 iface, D3DSURFACE_DESC *pDesc);
660 extern HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect,DWORD Flags);
661 extern HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface);
663 /* internal Interfaces */
664 extern HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenum gl_target, GLenum gl_level);
665 extern HRESULT WINAPI IDirect3DSurface8Impl_SaveSnapshot(LPDIRECT3DSURFACE8 iface, const char* filename);
666 extern HRESULT WINAPI IDirect3DSurface8Impl_CleanDirtyRect(LPDIRECT3DSURFACE8 iface);
667 extern HRESULT WINAPI IDirect3DSurface8Impl_AddDirtyRect(LPDIRECT3DSURFACE8 iface, CONST RECT* pDirtyRect);
669 /* ------------------ */
670 /* IDirect3DResource8 */
671 /* ------------------ */
673 /*****************************************************************************
674 * Predeclare the interface implementation structures
676 extern IDirect3DResource8Vtbl Direct3DResource8_Vtbl;
678 /*****************************************************************************
679 * IDirect3DResource8 implementation structure
681 struct IDirect3DResource8Impl
683 /* IUnknown fields */
684 IDirect3DResource8Vtbl *lpVtbl;
687 /* IDirect3DResource8 fields */
688 IDirect3DDevice8Impl *Device;
689 D3DRESOURCETYPE ResourceType;
693 extern HRESULT WINAPI IDirect3DResource8Impl_QueryInterface(LPDIRECT3DRESOURCE8 iface,REFIID refiid,LPVOID *obj);
694 extern ULONG WINAPI IDirect3DResource8Impl_AddRef(LPDIRECT3DRESOURCE8 iface);
695 extern ULONG WINAPI IDirect3DResource8Impl_Release(LPDIRECT3DRESOURCE8 iface);
697 /* IDirect3DResource8: */
698 extern HRESULT WINAPI IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface, IDirect3DDevice8** ppDevice);
699 extern HRESULT WINAPI IDirect3DResource8Impl_SetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
700 extern HRESULT WINAPI IDirect3DResource8Impl_GetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
701 extern HRESULT WINAPI IDirect3DResource8Impl_FreePrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid);
702 extern DWORD WINAPI IDirect3DResource8Impl_SetPriority(LPDIRECT3DRESOURCE8 iface, DWORD PriorityNew);
703 extern DWORD WINAPI IDirect3DResource8Impl_GetPriority(LPDIRECT3DRESOURCE8 iface);
704 extern void WINAPI IDirect3DResource8Impl_PreLoad(LPDIRECT3DRESOURCE8 iface);
705 extern D3DRESOURCETYPE WINAPI IDirect3DResource8Impl_GetType(LPDIRECT3DRESOURCE8 iface);
707 /* internal Interfaces */
708 extern D3DPOOL WINAPI IDirect3DResource8Impl_GetPool(LPDIRECT3DRESOURCE8 iface);
711 /* ---------------------- */
712 /* IDirect3DVertexBuffer8 */
713 /* ---------------------- */
715 /*****************************************************************************
716 * Predeclare the interface implementation structures
718 extern IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl;
720 /*****************************************************************************
721 * IDirect3DVertexBuffer8 implementation structure
723 struct IDirect3DVertexBuffer8Impl
725 /* IUnknown fields */
726 IDirect3DVertexBuffer8Vtbl *lpVtbl;
729 /* IDirect3DResource8 fields */
730 IDirect3DDevice8Impl *Device;
731 D3DRESOURCETYPE ResourceType;
733 /* IDirect3DVertexBuffer8 fields */
734 BYTE *allocatedMemory;
735 D3DVERTEXBUFFER_DESC currentDesc;
739 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_QueryInterface(LPDIRECT3DVERTEXBUFFER8 iface,REFIID refiid,LPVOID *obj);
740 extern ULONG WINAPI IDirect3DVertexBuffer8Impl_AddRef(LPDIRECT3DVERTEXBUFFER8 iface);
741 extern ULONG WINAPI IDirect3DVertexBuffer8Impl_Release(LPDIRECT3DVERTEXBUFFER8 iface);
743 /* IDirect3DVertexBuffer8: (Inherited from IDirect3DResource8) */
744 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDevice(LPDIRECT3DVERTEXBUFFER8 iface, IDirect3DDevice8** ppDevice);
745 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
746 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
747 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_FreePrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid);
748 extern DWORD WINAPI IDirect3DVertexBuffer8Impl_SetPriority(LPDIRECT3DVERTEXBUFFER8 iface, DWORD PriorityNew);
749 extern DWORD WINAPI IDirect3DVertexBuffer8Impl_GetPriority(LPDIRECT3DVERTEXBUFFER8 iface);
750 extern void WINAPI IDirect3DVertexBuffer8Impl_PreLoad(LPDIRECT3DVERTEXBUFFER8 iface);
751 extern D3DRESOURCETYPE WINAPI IDirect3DVertexBuffer8Impl_GetType(LPDIRECT3DVERTEXBUFFER8 iface);
753 /* IDirect3DVertexBuffer8: */
754 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_Lock(LPDIRECT3DVERTEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
755 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_Unlock(LPDIRECT3DVERTEXBUFFER8 iface);
756 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8 iface, D3DVERTEXBUFFER_DESC *pDesc);
759 /* --------------------- */
760 /* IDirect3DIndexBuffer8 */
761 /* --------------------- */
763 /*****************************************************************************
764 * Predeclare the interface implementation structures
766 extern IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl;
768 /*****************************************************************************
769 * IDirect3DIndexBuffer8 implementation structure
771 struct IDirect3DIndexBuffer8Impl
773 /* IUnknown fields */
774 IDirect3DIndexBuffer8Vtbl *lpVtbl;
777 /* IDirect3DResource8 fields */
778 IDirect3DDevice8Impl *Device;
779 D3DRESOURCETYPE ResourceType;
781 /* IDirect3DIndexBuffer8 fields */
782 void *allocatedMemory;
783 D3DINDEXBUFFER_DESC currentDesc;
787 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_QueryInterface(LPDIRECT3DINDEXBUFFER8 iface,REFIID refiid,LPVOID *obj);
788 extern ULONG WINAPI IDirect3DIndexBuffer8Impl_AddRef(LPDIRECT3DINDEXBUFFER8 iface);
789 extern ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 iface);
791 /* IDirect3DIndexBuffer8: (Inherited from IDirect3DResource8) */
792 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDevice(LPDIRECT3DINDEXBUFFER8 iface, IDirect3DDevice8** ppDevice);
793 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
794 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
795 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid);
796 extern DWORD WINAPI IDirect3DIndexBuffer8Impl_SetPriority(LPDIRECT3DINDEXBUFFER8 iface, DWORD PriorityNew);
797 extern DWORD WINAPI IDirect3DIndexBuffer8Impl_GetPriority(LPDIRECT3DINDEXBUFFER8 iface);
798 extern void WINAPI IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 iface);
799 extern D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer8Impl_GetType(LPDIRECT3DINDEXBUFFER8 iface);
801 /* IDirect3DIndexBuffer8: */
802 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
803 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 iface);
804 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 iface, D3DINDEXBUFFER_DESC *pDesc);
807 /* --------------------- */
808 /* IDirect3DBaseTexture8 */
809 /* --------------------- */
811 /*****************************************************************************
812 * Predeclare the interface implementation structures
814 extern IDirect3DBaseTexture8Vtbl Direct3DBaseTexture8_Vtbl;
816 /*****************************************************************************
817 * IDirect3DBaseTexture8 implementation structure
819 struct IDirect3DBaseTexture8Impl
821 /* IUnknown fields */
822 IDirect3DBaseTexture8Vtbl *lpVtbl;
825 /* IDirect3DResource8 fields */
826 IDirect3DDevice8Impl *Device;
827 D3DRESOURCETYPE ResourceType;
829 /* IDirect3DBaseTexture8 fields */
840 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_QueryInterface(LPDIRECT3DBASETEXTURE8 iface,REFIID refiid,LPVOID *obj);
841 extern ULONG WINAPI IDirect3DBaseTexture8Impl_AddRef(LPDIRECT3DBASETEXTURE8 iface);
842 extern ULONG WINAPI IDirect3DBaseTexture8Impl_Release(LPDIRECT3DBASETEXTURE8 iface);
844 /* IDirect3DBaseTexture8: (Inherited from IDirect3DResource8) */
845 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_GetDevice(LPDIRECT3DBASETEXTURE8 iface, IDirect3DDevice8** ppDevice);
846 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_SetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
847 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_GetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
848 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_FreePrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid);
849 extern DWORD WINAPI IDirect3DBaseTexture8Impl_SetPriority(LPDIRECT3DBASETEXTURE8 iface, DWORD PriorityNew);
850 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetPriority(LPDIRECT3DBASETEXTURE8 iface);
851 extern void WINAPI IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8 iface);
852 extern D3DRESOURCETYPE WINAPI IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8 iface);
854 /* IDirect3DBaseTexture8: */
855 extern DWORD WINAPI IDirect3DBaseTexture8Impl_SetLOD(LPDIRECT3DBASETEXTURE8 iface, DWORD LODNew);
856 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetLOD(LPDIRECT3DBASETEXTURE8 iface);
857 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetLevelCount(LPDIRECT3DBASETEXTURE8 iface);
859 /* internal Interfaces */
860 extern BOOL WINAPI IDirect3DBaseTexture8Impl_IsDirty(LPDIRECT3DBASETEXTURE8 iface);
861 extern BOOL WINAPI IDirect3DBaseTexture8Impl_SetDirty(LPDIRECT3DBASETEXTURE8 iface, BOOL dirty);
864 /* --------------------- */
865 /* IDirect3DCubeTexture8 */
866 /* --------------------- */
868 /*****************************************************************************
869 * Predeclare the interface implementation structures
871 extern IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl;
873 /*****************************************************************************
874 * IDirect3DCubeTexture8 implementation structure
876 struct IDirect3DCubeTexture8Impl
878 /* IUnknown fields */
879 IDirect3DCubeTexture8Vtbl *lpVtbl;
882 /* IDirect3DResource8 fields */
883 IDirect3DDevice8Impl *Device;
884 D3DRESOURCETYPE ResourceType;
886 /* IDirect3DBaseTexture8 fields */
891 /* IDirect3DCubeTexture8 fields */
895 IDirect3DSurface8Impl *surfaces[6][MAX_LEVELS];
899 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_QueryInterface(LPDIRECT3DCUBETEXTURE8 iface,REFIID refiid,LPVOID *obj);
900 extern ULONG WINAPI IDirect3DCubeTexture8Impl_AddRef(LPDIRECT3DCUBETEXTURE8 iface);
901 extern ULONG WINAPI IDirect3DCubeTexture8Impl_Release(LPDIRECT3DCUBETEXTURE8 iface);
903 /* IDirect3DCubeTexture8: (Inherited from IDirect3DResource8) */
904 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetDevice(LPDIRECT3DCUBETEXTURE8 iface, IDirect3DDevice8** ppDevice);
905 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
906 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
907 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_FreePrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid);
908 extern DWORD WINAPI IDirect3DCubeTexture8Impl_SetPriority(LPDIRECT3DCUBETEXTURE8 iface, DWORD PriorityNew);
909 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetPriority(LPDIRECT3DCUBETEXTURE8 iface);
910 extern void WINAPI IDirect3DCubeTexture8Impl_PreLoad(LPDIRECT3DCUBETEXTURE8 iface);
911 extern D3DRESOURCETYPE WINAPI IDirect3DCubeTexture8Impl_GetType(LPDIRECT3DCUBETEXTURE8 iface);
913 /* IDirect3DCubeTexture8: (Inherited from IDirect3DBaseTexture8) */
914 extern DWORD WINAPI IDirect3DCubeTexture8Impl_SetLOD(LPDIRECT3DCUBETEXTURE8 iface, DWORD LODNew);
915 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetLOD(LPDIRECT3DCUBETEXTURE8 iface);
916 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE8 iface);
918 /* IDirect3DCubeTexture8 */
919 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE8 iface, UINT Level, D3DSURFACE_DESC* pDesc);
920 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface8** ppCubeMapSurface);
921 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
922 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level);
923 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect);
926 /* ----------------- */
927 /* IDirect3DTexture8 */
928 /* ----------------- */
930 /*****************************************************************************
931 * Predeclare the interface implementation structures
933 extern IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl;
935 /*****************************************************************************
936 * IDirect3DTexture8 implementation structure
938 struct IDirect3DTexture8Impl
940 /* IUnknown fields */
941 IDirect3DTexture8Vtbl *lpVtbl;
944 /* IDirect3DResourc8 fields */
945 IDirect3DDevice8Impl *Device;
946 D3DRESOURCETYPE ResourceType;
948 /* IDirect3DBaseTexture8 fields */
953 /* IDirect3DTexture8 fields */
958 IDirect3DSurface8Impl *surfaces[MAX_LEVELS];
962 extern HRESULT WINAPI IDirect3DTexture8Impl_QueryInterface(LPDIRECT3DTEXTURE8 iface,REFIID refiid,LPVOID *obj);
963 extern ULONG WINAPI IDirect3DTexture8Impl_AddRef(LPDIRECT3DTEXTURE8 iface);
964 extern ULONG WINAPI IDirect3DTexture8Impl_Release(LPDIRECT3DTEXTURE8 iface);
966 /* IDirect3DTexture8: (Inherited from IDirect3DResource8) */
967 extern HRESULT WINAPI IDirect3DTexture8Impl_GetDevice(LPDIRECT3DTEXTURE8 iface, IDirect3DDevice8** ppDevice);
968 extern HRESULT WINAPI IDirect3DTexture8Impl_SetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
969 extern HRESULT WINAPI IDirect3DTexture8Impl_GetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
970 extern HRESULT WINAPI IDirect3DTexture8Impl_FreePrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid);
971 extern DWORD WINAPI IDirect3DTexture8Impl_SetPriority(LPDIRECT3DTEXTURE8 iface, DWORD PriorityNew);
972 extern DWORD WINAPI IDirect3DTexture8Impl_GetPriority(LPDIRECT3DTEXTURE8 iface);
973 extern void WINAPI IDirect3DTexture8Impl_PreLoad(LPDIRECT3DTEXTURE8 iface);
974 extern D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(LPDIRECT3DTEXTURE8 iface);
976 /* IDirect3DTexture8: (Inherited from IDirect3DBaseTexture8) */
977 extern DWORD WINAPI IDirect3DTexture8Impl_SetLOD(LPDIRECT3DTEXTURE8 iface, DWORD LODNew);
978 extern DWORD WINAPI IDirect3DTexture8Impl_GetLOD(LPDIRECT3DTEXTURE8 iface);
979 extern DWORD WINAPI IDirect3DTexture8Impl_GetLevelCount(LPDIRECT3DTEXTURE8 iface);
981 /* IDirect3DTexture8: */
982 extern HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(LPDIRECT3DTEXTURE8 iface, UINT Level, D3DSURFACE_DESC* pDesc);
983 extern HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE8 iface, UINT Level, IDirect3DSurface8** ppSurfaceLevel);
984 extern HRESULT WINAPI IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
985 extern HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(LPDIRECT3DTEXTURE8 iface, UINT Level);
986 extern HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(LPDIRECT3DTEXTURE8 iface, CONST RECT* pDirtyRect);
989 /* ----------------------- */
990 /* IDirect3DVolumeTexture8 */
991 /* ----------------------- */
993 /*****************************************************************************
994 * Predeclare the interface implementation structures
996 extern IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl;
998 /*****************************************************************************
999 * IDirect3DVolumeTexture8 implementation structure
1001 struct IDirect3DVolumeTexture8Impl
1003 /* IUnknown fields */
1004 IDirect3DVolumeTexture8Vtbl *lpVtbl;
1007 /* IDirect3DResource8 fields */
1008 IDirect3DDevice8Impl *Device;
1009 D3DRESOURCETYPE ResourceType;
1011 /* IDirect3DBaseTexture8 fields */
1016 /* IDirect3DVolumeTexture8 fields */
1022 IDirect3DVolume8Impl *volumes[MAX_LEVELS];
1026 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE8 iface,REFIID refiid,LPVOID *obj);
1027 extern ULONG WINAPI IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8 iface);
1028 extern ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8 iface);
1030 /* IDirect3DVolumeTexture8: (Inherited from IDirect3DResource8) */
1031 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE8 iface, IDirect3DDevice8** ppDevice);
1032 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
1033 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
1034 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid);
1035 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD PriorityNew);
1036 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE8 iface);
1037 extern void WINAPI IDirect3DVolumeTexture8Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE8 iface);
1038 extern D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture8Impl_GetType(LPDIRECT3DVOLUMETEXTURE8 iface);
1040 /* IDirect3DVolumeTexture8: (Inherited from IDirect3DBaseTexture8) */
1041 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD LODNew);
1042 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE8 iface);
1043 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE8 iface);
1045 /* IDirect3DVolumeTexture8: */
1046 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DVOLUME_DESC *pDesc);
1047 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, IDirect3DVolume8** ppVolumeLevel);
1048 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
1049 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level);
1050 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE8 iface, CONST D3DBOX* pDirtyBox);
1053 /* ==============================================================================
1054 Private interfactes: beginning of cleaning/splitting for HAL and d3d9 support
1055 ============================================================================== */
1057 /* State Block for Begin/End/Capture/Create/Apply State Block */
1058 /* Note: Very long winded but I do not believe gl Lists will */
1059 /* resolve everything we need, so doing it manually for now */
1060 typedef struct SAVEDSTATES {
1063 BOOL stream_source[MAX_STREAMS];
1065 BOOL transform[HIGHEST_TRANSFORMSTATE];
1068 BOOL vertexShaderConstant;
1069 BOOL vertexShaderDecl;
1071 BOOL pixelShaderConstant;
1072 BOOL renderstate[HIGHEST_RENDER_STATE];
1073 BOOL texture_state[8][HIGHEST_TEXTURE_STATE];
1074 BOOL clipplane[MAX_CLIPPLANES];
1078 /* ----------------------- */
1079 /* IDirect3DStateBlockImpl */
1080 /* ----------------------- */
1082 /*****************************************************************************
1083 * Predeclare the interface implementation structures
1085 /*extern IDirect3DStateBlock9Vtbl Direct3DStateBlock9_Vtbl;*/
1087 /*****************************************************************************
1088 * IDirect3DStateBlock implementation structure
1090 struct IDirect3DStateBlockImpl {
1091 /* IUnknown fields */
1092 /*IDirect3DStateBlock9Vtbl *lpVtbl;*/
1095 /* The device, to be replaced by a IDirect3DDeviceImpl */
1096 IDirect3DDevice8Impl* device;
1098 D3DSTATEBLOCKTYPE blockType;
1100 SAVEDSTATES Changed;
1104 double clipplane[MAX_CLIPPLANES][4];
1105 D3DCLIPSTATUS8 clip_status;
1108 UINT stream_stride[MAX_STREAMS];
1109 IDirect3DVertexBuffer8 *stream_source[MAX_STREAMS];
1113 IDirect3DIndexBuffer8* pIndexData;
1114 UINT baseVertexIndex;
1117 IDirect3DBaseTexture8 *textures[8];
1118 int textureDimensions[8];
1119 /* Texture State Stage */
1120 DWORD texture_state[8][HIGHEST_TEXTURE_STATE];
1123 PLIGHTINFOEL *lights; /* NOTE: active GL lights must be front of the chain */
1126 D3DMATERIAL8 material;
1129 DWORD renderstate[HIGHEST_RENDER_STATE];
1132 D3DMATRIX transforms[HIGHEST_TRANSFORMSTATE];
1135 D3DVIEWPORT8 viewport;
1140 /* Vertex Shader Declaration */
1141 IDirect3DVertexShaderDeclarationImpl* vertexShaderDecl;
1146 /* Indexed Vertex Blending */
1147 D3DVERTEXBLENDFLAGS vertex_blend;
1150 /* Vertex Shader Constant */
1151 D3DSHADERVECTOR vertexShaderConstant[D3D8_VSHADER_MAX_CONSTANTS];
1152 /* Pixel Shader Constant */
1153 D3DSHADERVECTOR pixelShaderConstant[D3D8_PSHADER_MAX_CONSTANTS];
1156 /* exported Interfaces */
1157 /* internal Interfaces */
1158 /* temporary internal Interfaces */
1159 extern HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* This);
1160 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateStateBlock(IDirect3DDevice8Impl* This, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlockImpl** ppStateBlock);
1161 extern HRESULT WINAPI IDirect3DDeviceImpl_DeleteStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl* pSB);
1162 extern HRESULT WINAPI IDirect3DDeviceImpl_BeginStateBlock(IDirect3DDevice8Impl* This);
1163 extern HRESULT WINAPI IDirect3DDeviceImpl_EndStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl** ppStateBlock);
1164 extern HRESULT WINAPI IDirect3DDeviceImpl_ApplyStateBlock(IDirect3DDevice8Impl* iface, IDirect3DStateBlockImpl* pSB);
1165 extern HRESULT WINAPI IDirect3DDeviceImpl_CaptureStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl* pSB);
1167 /* ------------------------------------ */
1168 /* IDirect3DVertexShaderDeclarationImpl */
1169 /* ------------------------------------ */
1171 /*****************************************************************************
1172 * Predeclare the interface implementation structures
1174 /*extern IDirect3DVertexShaderDeclaration9Vtbl Direct3DVertexShaderDeclaration9_Vtbl;*/
1176 /*****************************************************************************
1177 * IDirect3DVertexShaderDeclaration implementation structure
1179 struct IDirect3DVertexShaderDeclarationImpl {
1180 /* IUnknown fields */
1181 /*IDirect3DVertexShaderDeclaration9Vtbl *lpVtbl;*/
1184 /* The device, to be replaced by a IDirect3DDeviceImpl */
1185 IDirect3DDevice8Impl* device;
1187 /** precomputed fvf if simple declaration */
1188 DWORD fvf[MAX_STREAMS];
1191 /** dx8 compatible Declaration fields */
1192 DWORD* pDeclaration8;
1193 DWORD declaration8Length;
1196 /* exported Interfaces */
1197 extern HRESULT WINAPI IDirect3DVertexShaderDeclarationImpl_GetDeclaration8(IDirect3DVertexShaderDeclarationImpl* This, DWORD* pData, UINT* pSizeOfData);
1198 /*extern HRESULT IDirect3DVertexShaderDeclarationImpl_GetDeclaration9(IDirect3DVertexShaderDeclarationImpl* This, D3DVERTEXELEMENT9* pData, UINT* pNumElements);*/
1199 /* internal Interfaces */
1200 /* temporary internal Interfaces */
1201 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateVertexShaderDeclaration8(IDirect3DDevice8Impl* This, CONST DWORD* pDeclaration8, IDirect3DVertexShaderDeclarationImpl** ppVertexShaderDecl);
1204 /* ------------------------- */
1205 /* IDirect3DVertexShaderImpl */
1206 /* ------------------------- */
1208 /*****************************************************************************
1209 * Predeclare the interface implementation structures
1211 /*extern IDirect3DVertexShader9Vtbl Direct3DVertexShader9_Vtbl;*/
1213 /*****************************************************************************
1214 * IDirect3DVertexShader implementation structure
1216 struct IDirect3DVertexShaderImpl {
1217 /*IDirect3DVertexShader9Vtbl *lpVtbl;*/
1220 /* The device, to be replaced by a IDirect3DDeviceImpl */
1221 IDirect3DDevice8Impl* device;
1224 UINT functionLength;
1225 DWORD usage; /* 0 || D3DUSAGE_SOFTWAREPROCESSING */
1228 /** fields for hw vertex shader use */
1231 /* run time datas */
1233 VSHADERINPUTDATA8 input;
1234 VSHADEROUTPUTDATA8 output;
1237 /* exported Interfaces */
1238 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetFunction(IDirect3DVertexShaderImpl* This, VOID* pData, UINT* pSizeOfData);
1239 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);*/
1240 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST INT* pConstantData, UINT Vector4iCount);*/
1241 extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount);
1242 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);*/
1243 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, INT* pConstantData, UINT Vector4iCount);*/
1244 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, FLOAT* pConstantData, UINT Vector4fCount);
1245 /* internal Interfaces */
1246 extern DWORD WINAPI IDirect3DVertexShaderImpl_GetVersion(IDirect3DVertexShaderImpl* This);
1247 extern HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* This, VSHADERINPUTDATA8* input, VSHADEROUTPUTDATA8* output);
1248 /* temporary internal Interfaces */
1249 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateVertexShader(IDirect3DDevice8Impl* This, CONST DWORD* pFunction, DWORD Usage, IDirect3DVertexShaderImpl** ppVertexShader);
1250 extern HRESULT WINAPI IDirect3DDeviceImpl_FillVertexShaderInputSW(IDirect3DDevice8Impl* This, IDirect3DVertexShaderImpl* vshader, DWORD SkipnStrides);
1251 extern HRESULT WINAPI IDirect3DDeviceImpl_FillVertexShaderInputArbHW(IDirect3DDevice8Impl* This, IDirect3DVertexShaderImpl* vshader, DWORD SkipnStrides);
1253 /* ------------------------ */
1254 /* IDirect3DPixelShaderImpl */
1255 /* ------------------------ */
1257 /*****************************************************************************
1258 * Predeclare the interface implementation structures
1260 /*extern IDirect3DPixelShader9Vtbl Direct3DPixelShader9_Vtbl;*/
1262 /*****************************************************************************
1263 * IDirect3DPixelShader implementation structure
1265 struct IDirect3DPixelShaderImpl {
1266 /*IDirect3DPixelShader9Vtbl *lpVtbl;*/
1269 /* The device, to be replaced by a IDirect3DDeviceImpl */
1270 IDirect3DDevice8Impl* device;
1273 UINT functionLength;
1276 /** fields for hw pixel shader use */
1279 /* run time datas */
1281 PSHADERINPUTDATA8 input;
1282 PSHADEROUTPUTDATA8 output;
1285 /* exported Interfaces */
1286 extern HRESULT WINAPI IDirect3DPixelShaderImpl_GetFunction(IDirect3DPixelShaderImpl* This, VOID* pData, UINT* pSizeOfData);
1287 extern HRESULT WINAPI IDirect3DPixelShaderImpl_SetConstantF(IDirect3DPixelShaderImpl* This, UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount);
1288 /* internal Interfaces */
1289 extern DWORD WINAPI IDirect3DPixelShaderImpl_GetVersion(IDirect3DPixelShaderImpl* This);
1290 /* temporary internal Interfaces */
1291 extern HRESULT WINAPI IDirect3DDeviceImpl_CreatePixelShader(IDirect3DDevice8Impl* This, CONST DWORD* pFunction, IDirect3DPixelShaderImpl** ppPixelShader);
1295 * Internals functions
1297 * to see how not defined it here
1299 void GetSrcAndOpFromValue(DWORD iValue, BOOL isAlphaArg, GLenum* source, GLenum* operand);
1300 void setupTextureStates(LPDIRECT3DDEVICE8 iface, DWORD Stage, DWORD Flags);
1301 void set_tex_op(LPDIRECT3DDEVICE8 iface, BOOL isAlpha, int Stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3);
1303 SHORT D3DFmtGetBpp(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1304 GLint D3DFmt2GLIntFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1305 GLenum D3DFmt2GLFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1306 GLenum D3DFmt2GLType(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1308 GLenum D3DFmt2GLDepthFmt(D3DFORMAT fmt);
1309 GLenum D3DFmt2GLDepthType(D3DFORMAT fmt);
1311 int D3DPrimitiveListGetVertexSize(D3DPRIMITIVETYPE PrimitiveType, int iNumPrim);
1312 int D3DPrimitive2GLenum(D3DPRIMITIVETYPE PrimitiveType);
1313 int D3DFVFGetSize(D3DFORMAT fvf);
1315 int SOURCEx_RGB_EXT(DWORD arg);
1316 int OPERANDx_RGB_EXT(DWORD arg);
1317 int SOURCEx_ALPHA_EXT(DWORD arg);
1318 int OPERANDx_ALPHA_EXT(DWORD arg);
1319 GLenum StencilOp(DWORD op);
1322 * Internals debug functions
1324 const char* debug_d3ddevicetype(D3DDEVTYPE devtype);
1325 const char* debug_d3dusage(DWORD usage);
1326 const char* debug_d3dformat(D3DFORMAT fmt);
1327 const char* debug_d3dressourcetype(D3DRESOURCETYPE res);
1328 const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType);
1329 const char* debug_d3dpool(D3DPOOL Pool);
1330 const char *debug_d3drenderstate(DWORD State);
1331 const char *debug_d3dtexturestate(DWORD State);
1333 /* Some #defines for additional diagnostics */
1334 #if 0 /* NOTE: Must be 0 in cvs */
1335 /* To avoid having to get gigabytes of trace, the following can be compiled in, and at the start
1336 of each frame, a check is made for the existence of C:\D3DTRACE, and if if exists d3d trace
1337 is enabled, and if it doesn't exists it is disabled. */
1338 # define FRAME_DEBUGGING
1339 /* Adding in the SINGLE_FRAME_DEBUGGING gives a trace of just what makes up a single frame, before
1340 the file is deleted */
1341 # if 1 /* NOTE: Must be 1 in cvs, as this is mostly more useful than a trace from program start */
1342 # define SINGLE_FRAME_DEBUGGING
1344 /* The following, when enabled, lets you see the makeup of the frame, by drawprimitive calls.
1345 It can only be enabled when FRAME_DEBUGGING is also enabled
1346 The contents of the back buffer are written into /tmp/backbuffer_* after each primitive
1348 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
1349 # define SHOW_FRAME_MAKEUP 1
1351 /* The following, when enabled, lets you see the makeup of the all the textures used during each
1352 of the drawprimitive calls. It can only be enabled when SHOW_FRAME_MAKEUP is also enabled.
1353 The contents of the textures assigned to each stage are written into
1354 /tmp/texture_*_<Stage>.ppm after each primitive array is drawn. */
1355 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
1356 # define SHOW_TEXTURE_MAKEUP 0
1359 extern BOOL isDumpingFrames;
1360 extern LONG primCounter;
1363 /* Per-vertex trace: */
1364 #if 0 /* NOTE: Must be 0 in cvs */
1365 # define VTRACE(A) TRACE A
1370 #define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w);
1371 #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);
1373 #define DUMP_LIGHT_CHAIN() \
1375 PLIGHTINFOEL *el = This->StateBlock->lights;\
1377 TRACE("Light %p (glIndex %ld, d3dIndex %ld, enabled %d)\n", el, el->glIndex, el->OriginalIndex, el->lightEnabled);\
1382 #endif /* __WINE_D3DX8_PRIVATE_H */