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()
76 #define MAX_PALETTES 256
77 #define MAX_STREAMS 16
78 #define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
79 #define MAX_LEVELS 256
81 /* Other useful values */
82 #define HIGHEST_RENDER_STATE 174
83 #define HIGHEST_TEXTURE_STATE 29
84 #define HIGHEST_TRANSFORMSTATE 512
85 #define D3DSBT_RECORDED 0xfffffffe
87 /* Performance changes - Only reapply what is necessary */
88 #define REAPPLY_ALPHAOP 0x0001
89 #define REAPPLY_ALL 0xFFFF
91 /* CreateVertexShader can return > 0xFFFF */
92 #define VS_HIGHESTFIXEDFXF 0xF0000000
93 #define VERTEX_SHADER(Handle) \
94 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(VertexShaders) / sizeof(IDirect3DVertexShaderImpl*)) ? NULL : VertexShaders[Handle]) : VertexShaders[Handle - VS_HIGHESTFIXEDFXF])
95 #define VERTEX_SHADER_DECL(Handle) \
96 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(VertexShaderDeclarations) / sizeof(IDirect3DVertexShaderDeclarationImpl*)) ? NULL : VertexShaderDeclarations[Handle]) : VertexShaderDeclarations[Handle - VS_HIGHESTFIXEDFXF])
97 #define PIXEL_SHADER(Handle) \
98 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(PixelShaders) / sizeof(IDirect3DPixelShaderImpl*)) ? NULL : PixelShaders[Handle]) : PixelShaders[Handle - VS_HIGHESTFIXEDFXF])
100 /* Direct3D8 Interfaces: */
101 typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
102 typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
103 typedef struct IDirect3D8Impl IDirect3D8Impl;
104 typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
105 typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
106 typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
107 typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
108 typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
109 typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
110 typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
111 typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
112 typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
114 /** Private Interfaces: */
115 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
116 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
117 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
118 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
120 typedef struct D3DSHADERVECTOR {
127 typedef struct D3DSHADERSCALAR {
131 #define D3D8_VSHADER_MAX_CONSTANTS 96
132 typedef D3DSHADERVECTOR VSHADERCONSTANTS8[D3D8_VSHADER_MAX_CONSTANTS];
134 typedef struct VSHADERDATA8 {
135 /** Run Time Shader Function Constants */
136 /*D3DXBUFFER* constants;*/
138 /** Shader Code as char ... */
143 /** temporary here waiting for buffer code */
144 typedef struct VSHADERINPUTDATA8 {
145 D3DSHADERVECTOR V[17];
148 /** temporary here waiting for buffer code */
149 typedef struct VSHADEROUTPUTDATA8 {
150 D3DSHADERVECTOR oPos;
151 D3DSHADERVECTOR oD[2];
152 D3DSHADERVECTOR oT[8];
153 D3DSHADERVECTOR oFog;
154 D3DSHADERVECTOR oPts;
155 } VSHADEROUTPUTDATA8;
158 #define D3D8_PSHADER_MAX_CONSTANTS 32
159 typedef D3DSHADERVECTOR PSHADERCONSTANTS8[D3D8_PSHADER_MAX_CONSTANTS];
161 typedef struct PSHADERDATA8 {
162 /** Run Time Shader Function Constants */
163 /*D3DXBUFFER* constants;*/
165 /** Shader Code as char ... */
170 /** temporary here waiting for buffer code */
171 typedef struct PSHADERINPUTDATA8 {
172 D3DSHADERVECTOR V[2];
173 D3DSHADERVECTOR T[8];
174 D3DSHADERVECTOR S[16];
175 /*D3DSHADERVECTOR R[12];*/
178 /** temporary here waiting for buffer code */
179 typedef struct PSHADEROUTPUTDATA8 {
180 D3DSHADERVECTOR oC[4];
181 D3DSHADERVECTOR oDepth;
182 } PSHADEROUTPUTDATA8;
185 * Private definitions for internal use only
187 typedef struct PLIGHTINFOEL PLIGHTINFOEL;
188 struct PLIGHTINFOEL {
189 D3DLIGHT8 OriginalParms;
196 /* Converted parms to speed up swapping lights */
209 #define checkGLcall(A) \
211 GLint err = glGetError(); \
212 if (err != GL_NO_ERROR) { \
213 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
215 TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \
218 #define vcheckGLcall(A) \
220 GLint err = glGetError(); \
221 if (err != GL_NO_ERROR) { \
222 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
224 VTRACE(("%s call ok %s / %d\n", A, __FILE__, __LINE__)); \
228 #include "d3dcore_gl.h"
231 #define GL_LIMITS(ExtName) (This->direct3d8->gl_info.max_##ExtName)
232 #define GL_SUPPORT(ExtName) (TRUE == This->direct3d8->gl_info.supported[ExtName])
233 #define GL_SUPPORT_DEV(ExtName, dev) (TRUE == (dev)->direct3d8->gl_info.supported[ExtName])
234 #define GL_EXTCALL(FuncName) (This->direct3d8->gl_info.FuncName)
237 #define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f)
238 #define D3DCOLOR_G(dw) (((float) (((dw) >> 8) & 0xFF)) / 255.0f)
239 #define D3DCOLOR_B(dw) (((float) (((dw) >> 0) & 0xFF)) / 255.0f)
240 #define D3DCOLOR_A(dw) (((float) (((dw) >> 24) & 0xFF)) / 255.0f)
242 #define D3DCOLORTOCOLORVALUE(dw, col) \
243 (col).r = D3DCOLOR_R(dw); \
244 (col).g = D3DCOLOR_G(dw); \
245 (col).b = D3DCOLOR_B(dw); \
246 (col).a = D3DCOLOR_A(dw);
248 #define D3DCOLORTOVECTOR4(dw, vec) \
249 (vec).x = D3DCOLOR_R(dw); \
250 (vec).y = D3DCOLOR_G(dw); \
251 (vec).z = D3DCOLOR_B(dw); \
252 (vec).w = D3DCOLOR_A(dw);
254 #define D3DCOLORTOGLFLOAT4(dw, vec) \
255 (vec)[0] = D3DCOLOR_R(dw); \
256 (vec)[1] = D3DCOLOR_G(dw); \
257 (vec)[2] = D3DCOLOR_B(dw); \
258 (vec)[3] = D3DCOLOR_A(dw);
260 /* ===========================================================================
261 The interfactes themselves
262 =========================================================================== */
268 /*****************************************************************************
269 * Predeclare the interface implementation structures
271 extern ICOM_VTABLE(IDirect3D8) Direct3D8_Vtbl;
273 /*****************************************************************************
274 * IDirect3D implementation structure
276 struct IDirect3D8Impl
278 /* IUnknown fields */
279 ICOM_VFIELD(IDirect3D8);
282 /* IDirect3D8 fields */
285 IDirect3D8Impl *direct3d8;
289 extern HRESULT WINAPI IDirect3D8Impl_QueryInterface(LPDIRECT3D8 iface,REFIID refiid,LPVOID *obj);
290 extern ULONG WINAPI IDirect3D8Impl_AddRef(LPDIRECT3D8 iface);
291 extern ULONG WINAPI IDirect3D8Impl_Release(LPDIRECT3D8 iface);
294 extern HRESULT WINAPI IDirect3D8Impl_RegisterSoftwareDevice(LPDIRECT3D8 iface, void* pInitializeFunction);
295 extern UINT WINAPI IDirect3D8Impl_GetAdapterCount(LPDIRECT3D8 iface);
296 extern HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier(LPDIRECT3D8 iface, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER8* pIdentifier);
297 extern UINT WINAPI IDirect3D8Impl_GetAdapterModeCount(LPDIRECT3D8 iface, UINT Adapter);
298 extern HRESULT WINAPI IDirect3D8Impl_EnumAdapterModes(LPDIRECT3D8 iface, UINT Adapter, UINT Mode, D3DDISPLAYMODE* pMode);
299 extern HRESULT WINAPI IDirect3D8Impl_GetAdapterDisplayMode(LPDIRECT3D8 iface, UINT Adapter, D3DDISPLAYMODE* pMode);
300 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceType(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat,
301 D3DFORMAT BackBufferFormat, BOOL Windowed);
302 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
303 DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
304 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceMultiSampleType(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat,
305 BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType);
306 extern HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
307 D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
308 extern HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps);
309 extern HMONITOR WINAPI IDirect3D8Impl_GetAdapterMonitor(LPDIRECT3D8 iface, UINT Adapter);
310 extern HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
311 DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
312 IDirect3DDevice8** ppReturnedDeviceInterface);
314 /* ---------------- */
315 /* IDirect3DDevice8 */
316 /* ---------------- */
318 /*****************************************************************************
319 * Predeclare the interface implementation structures
321 extern ICOM_VTABLE(IDirect3DDevice8) Direct3DDevice8_Vtbl;
323 /*****************************************************************************
324 * IDirect3DDevice8 implementation structure
326 struct IDirect3DDevice8Impl
328 /* IUnknown fields */
329 ICOM_VFIELD(IDirect3DDevice8);
332 /* IDirect3DDevice8 fields */
333 IDirect3D8Impl *direct3d8;
335 IDirect3DSurface8Impl *frontBuffer;
336 IDirect3DSurface8Impl *backBuffer;
337 IDirect3DSurface8Impl *depthStencilBuffer;
339 IDirect3DSurface8Impl *renderTarget;
340 IDirect3DSurface8Impl *stencilBufferTarget;
342 D3DPRESENT_PARAMETERS PresentParms;
343 D3DDEVICE_CREATION_PARAMETERS CreateParms;
353 /* State block related */
354 BOOL isRecordingState;
355 IDirect3DStateBlockImpl *StateBlock;
356 IDirect3DStateBlockImpl *UpdateStateBlock;
358 /* palettes texture management */
359 PALETTEENTRY palettes[MAX_PALETTES][256];
363 BOOL modelview_valid;
365 BOOL view_ident; /* true iff view matrix is identity */
366 BOOL last_was_rhw; /* true iff last draw_primitive was in xyzrhw mode */
367 GLenum tracking_parm; /* Which source is tracking current colour */
368 LONG tracking_color; /* used iff GL_COLOR_MATERIAL was enabled */
369 #define DISABLED_TRACKING 0 /* Disabled */
370 #define IS_TRACKING 1 /* tracking_parm is tracking diffuse color */
371 #define NEEDS_TRACKING 2 /* Tracking needs to be enabled when needed */
372 #define NEEDS_DISABLE 3 /* Tracking needs to be disabled when needed*/
376 XVisualInfo *visInfo;
380 GLXContext render_ctx;
382 GLint maxConcurrentLights;
384 /* OpenGL Extension related */
386 /* Cursor management */
394 UINT dummyTextureName[8];
399 extern HRESULT WINAPI IDirect3DDevice8Impl_QueryInterface(LPDIRECT3DDEVICE8 iface, REFIID refiid, LPVOID *obj);
400 extern ULONG WINAPI IDirect3DDevice8Impl_AddRef(LPDIRECT3DDEVICE8 iface);
401 extern ULONG WINAPI IDirect3DDevice8Impl_Release(LPDIRECT3DDEVICE8 iface);
403 /* IDirect3DDevice8: */
404 extern HRESULT WINAPI IDirect3DDevice8Impl_TestCooperativeLevel(LPDIRECT3DDEVICE8 iface);
405 extern UINT WINAPI IDirect3DDevice8Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE8 iface);
406 extern HRESULT WINAPI IDirect3DDevice8Impl_ResourceManagerDiscardBytes(LPDIRECT3DDEVICE8 iface, DWORD Bytes);
407 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDirect3D(LPDIRECT3DDEVICE8 iface, IDirect3D8** ppD3D8);
408 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDeviceCaps(LPDIRECT3DDEVICE8 iface, D3DCAPS8* pCaps);
409 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDisplayMode(LPDIRECT3DDEVICE8 iface, D3DDISPLAYMODE* pMode);
410 extern HRESULT WINAPI IDirect3DDevice8Impl_GetCreationParameters(LPDIRECT3DDEVICE8 iface, D3DDEVICE_CREATION_PARAMETERS* pParameters);
411 extern HRESULT WINAPI IDirect3DDevice8Impl_SetCursorProperties(LPDIRECT3DDEVICE8 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8* pCursorBitmap);
412 extern void WINAPI IDirect3DDevice8Impl_SetCursorPosition(LPDIRECT3DDEVICE8 iface, UINT XScreenSpace, UINT YScreenSpace, DWORD Flags);
413 extern BOOL WINAPI IDirect3DDevice8Impl_ShowCursor(LPDIRECT3DDEVICE8 iface, BOOL bShow);
414 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain8** pSwapChain);
415 extern HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters);
416 extern HRESULT WINAPI IDirect3DDevice8Impl_Present(LPDIRECT3DDEVICE8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
417 extern HRESULT WINAPI IDirect3DDevice8Impl_GetBackBuffer(LPDIRECT3DDEVICE8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer);
418 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRasterStatus(LPDIRECT3DDEVICE8 iface, D3DRASTER_STATUS* pRasterStatus);
419 extern void WINAPI IDirect3DDevice8Impl_SetGammaRamp(LPDIRECT3DDEVICE8 iface, DWORD Flags, CONST D3DGAMMARAMP* pRamp);
420 extern void WINAPI IDirect3DDevice8Impl_GetGammaRamp(LPDIRECT3DDEVICE8 iface, D3DGAMMARAMP* pRamp);
421 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture8** ppTexture);
422 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture);
423 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture);
424 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer8** ppVertexBuffer);
425 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer8** ppIndexBuffer);
426 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateRenderTarget(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, BOOL Lockable, IDirect3DSurface8** ppSurface);
427 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, IDirect3DSurface8** ppSurface);
428 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateImageSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, IDirect3DSurface8** ppSurface);
429 extern HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, IDirect3DSurface8* pDestinationSurface, CONST POINT* pDestPointsArray);
430 extern HRESULT WINAPI IDirect3DDevice8Impl_UpdateTexture(LPDIRECT3DDEVICE8 iface, IDirect3DBaseTexture8* pSourceTexture, IDirect3DBaseTexture8* pDestinationTexture);
431 extern HRESULT WINAPI IDirect3DDevice8Impl_GetFrontBuffer(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pDestSurface);
432 extern HRESULT WINAPI IDirect3DDevice8Impl_SetRenderTarget(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pRenderTarget, IDirect3DSurface8* pNewZStencil);
433 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRenderTarget(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8** ppRenderTarget);
434 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8** ppZStencilSurface);
435 extern HRESULT WINAPI IDirect3DDevice8Impl_BeginScene(LPDIRECT3DDEVICE8 iface);
436 extern HRESULT WINAPI IDirect3DDevice8Impl_EndScene(LPDIRECT3DDEVICE8 iface);
437 extern HRESULT WINAPI IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil);
438 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
439 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
440 extern HRESULT WINAPI IDirect3DDevice8Impl_MultiplyTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
441 extern HRESULT WINAPI IDirect3DDevice8Impl_SetViewport(LPDIRECT3DDEVICE8 iface, CONST D3DVIEWPORT8* pViewport);
442 extern HRESULT WINAPI IDirect3DDevice8Impl_GetViewport(LPDIRECT3DDEVICE8 iface, D3DVIEWPORT8* pViewport);
443 extern HRESULT WINAPI IDirect3DDevice8Impl_SetMaterial(LPDIRECT3DDEVICE8 iface, CONST D3DMATERIAL8* pMaterial);
444 extern HRESULT WINAPI IDirect3DDevice8Impl_GetMaterial(LPDIRECT3DDEVICE8 iface, D3DMATERIAL8* pMaterial);
445 extern HRESULT WINAPI IDirect3DDevice8Impl_SetLight(LPDIRECT3DDEVICE8 iface, DWORD Index, CONST D3DLIGHT8* pLight);
446 extern HRESULT WINAPI IDirect3DDevice8Impl_GetLight(LPDIRECT3DDEVICE8 iface, DWORD Index, D3DLIGHT8* pLight);
447 extern HRESULT WINAPI IDirect3DDevice8Impl_LightEnable(LPDIRECT3DDEVICE8 iface, DWORD Index, BOOL Enable);
448 extern HRESULT WINAPI IDirect3DDevice8Impl_GetLightEnable(LPDIRECT3DDEVICE8 iface, DWORD Index, BOOL* pEnable);
449 extern HRESULT WINAPI IDirect3DDevice8Impl_SetClipPlane(LPDIRECT3DDEVICE8 iface, DWORD Index, CONST float* pPlane);
450 extern HRESULT WINAPI IDirect3DDevice8Impl_GetClipPlane(LPDIRECT3DDEVICE8 iface, DWORD Index, float* pPlane);
451 extern HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3DRENDERSTATETYPE State, DWORD Value);
452 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRenderState(LPDIRECT3DDEVICE8 iface, D3DRENDERSTATETYPE State, DWORD* pValue);
453 extern HRESULT WINAPI IDirect3DDevice8Impl_BeginStateBlock(LPDIRECT3DDEVICE8 iface);
454 extern HRESULT WINAPI IDirect3DDevice8Impl_EndStateBlock(LPDIRECT3DDEVICE8 iface, DWORD* pToken);
455 extern HRESULT WINAPI IDirect3DDevice8Impl_ApplyStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
456 extern HRESULT WINAPI IDirect3DDevice8Impl_CaptureStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
457 extern HRESULT WINAPI IDirect3DDevice8Impl_DeleteStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
458 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(LPDIRECT3DDEVICE8 iface, D3DSTATEBLOCKTYPE Type,DWORD* pToken);
459 extern HRESULT WINAPI IDirect3DDevice8Impl_SetClipStatus(LPDIRECT3DDEVICE8 iface, CONST D3DCLIPSTATUS8* pClipStatus);
460 extern HRESULT WINAPI IDirect3DDevice8Impl_GetClipStatus(LPDIRECT3DDEVICE8 iface, D3DCLIPSTATUS8* pClipStatus);
461 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage, IDirect3DBaseTexture8** ppTexture);
462 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage, IDirect3DBaseTexture8* pTexture);
463 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue);
464 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
465 extern HRESULT WINAPI IDirect3DDevice8Impl_ValidateDevice(LPDIRECT3DDEVICE8 iface, DWORD* pNumPasses);
466 extern HRESULT WINAPI IDirect3DDevice8Impl_GetInfo(LPDIRECT3DDEVICE8 iface, DWORD DevInfoID, void* pDevInfoStruct, DWORD DevInfoStructSize);
467 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPaletteEntries(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries);
468 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPaletteEntries(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber, PALETTEENTRY* pEntries);
469 extern HRESULT WINAPI IDirect3DDevice8Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber);
470 extern HRESULT WINAPI IDirect3DDevice8Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface, UINT *PaletteNumber);
471 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
472 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount);
473 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
474 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);
475 extern HRESULT WINAPI IDirect3DDevice8Impl_ProcessVertices(LPDIRECT3DDEVICE8 iface, UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags);
476 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage);
477 extern HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
478 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD* pHandle);
479 extern HRESULT WINAPI IDirect3DDevice8Impl_DeleteVertexShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
480 extern HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,CONST void* pConstantData,DWORD ConstantCount);
481 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,void* pConstantData,DWORD ConstantCount);
482 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderDeclaration(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
483 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
484 extern HRESULT WINAPI IDirect3DDevice8Impl_SetStreamSource(LPDIRECT3DDEVICE8 iface, UINT StreamNumber,IDirect3DVertexBuffer8* pStreamData,UINT Stride);
485 extern HRESULT WINAPI IDirect3DDevice8Impl_GetStreamSource(LPDIRECT3DDEVICE8 iface, UINT StreamNumber,IDirect3DVertexBuffer8** ppStreamData,UINT* pStride);
486 extern HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex);
487 extern HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex);
488 extern HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pFunction,DWORD* pHandle);
489 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
490 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD* pHandle);
491 extern HRESULT WINAPI IDirect3DDevice8Impl_DeletePixelShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
492 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,CONST void* pConstantData,DWORD ConstantCount);
493 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,void* pConstantData,DWORD ConstantCount);
494 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
495 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawRectPatch(LPDIRECT3DDEVICE8 iface, UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo);
496 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawTriPatch(LPDIRECT3DDEVICE8 iface, UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo);
497 extern HRESULT WINAPI IDirect3DDevice8Impl_DeletePatch(LPDIRECT3DDEVICE8 iface, UINT Handle);
499 /* internal Interfaces */
500 extern HRESULT WINAPI IDirect3DDevice8Impl_CleanRender(LPDIRECT3DDEVICE8 iface);
501 extern HRESULT WINAPI IDirect3DDevice8Impl_ActiveRender(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* RenderSurface, IDirect3DSurface8* StencilSurface);
504 /* ---------------- */
505 /* IDirect3DVolume8 */
506 /* ---------------- */
508 /*****************************************************************************
509 * Predeclare the interface implementation structures
511 extern ICOM_VTABLE(IDirect3DVolume8) Direct3DVolume8_Vtbl;
513 /*****************************************************************************
514 * IDirect3DVolume8 implementation structure
516 struct IDirect3DVolume8Impl
518 /* IUnknown fields */
519 ICOM_VFIELD(IDirect3DVolume8);
522 /* IDirect3DVolume8 fields */
523 IDirect3DDevice8Impl *Device;
524 D3DRESOURCETYPE ResourceType;
527 D3DVOLUME_DESC myDesc;
528 BYTE *allocatedMemory;
540 extern HRESULT WINAPI IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 iface,REFIID refiid,LPVOID *obj);
541 extern ULONG WINAPI IDirect3DVolume8Impl_AddRef(LPDIRECT3DVOLUME8 iface);
542 extern ULONG WINAPI IDirect3DVolume8Impl_Release(LPDIRECT3DVOLUME8 iface);
544 /* IDirect3DVolume8: */
545 extern HRESULT WINAPI IDirect3DVolume8Impl_GetDevice(LPDIRECT3DVOLUME8 iface, IDirect3DDevice8** ppDevice);
546 extern HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
547 extern HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
548 extern HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid);
549 extern HRESULT WINAPI IDirect3DVolume8Impl_GetContainer(LPDIRECT3DVOLUME8 iface, REFIID riid, void** ppContainer);
550 extern HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface, D3DVOLUME_DESC* pDesc);
551 extern HRESULT WINAPI IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
552 extern HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface);
554 /* internal Interfaces */
555 extern HRESULT WINAPI IDirect3DVolume8Impl_CleanDirtyBox(LPDIRECT3DVOLUME8 iface);
556 extern HRESULT WINAPI IDirect3DVolume8Impl_AddDirtyBox(LPDIRECT3DVOLUME8 iface, CONST D3DBOX* pDirtyBox);
558 /* ------------------- */
559 /* IDirect3DSwapChain8 */
560 /* ------------------- */
562 /*****************************************************************************
563 * Predeclare the interface implementation structures
565 extern ICOM_VTABLE(IDirect3DSwapChain8) Direct3DSwapChain8_Vtbl;
567 /*****************************************************************************
568 * IDirect3DSwapChain8 implementation structure
570 struct IDirect3DSwapChain8Impl
572 /* IUnknown fields */
573 ICOM_VFIELD(IDirect3DSwapChain8);
576 /* IDirect3DSwapChain8 fields */
577 IDirect3DSurface8Impl *frontBuffer;
578 IDirect3DSurface8Impl *backBuffer;
579 IDirect3DSurface8Impl *depthStencilBuffer;
580 D3DPRESENT_PARAMETERS PresentParms;
582 /* OpenGL/GLX related */
584 Drawable swap_drawable;
588 extern HRESULT WINAPI IDirect3DSwapChain8Impl_QueryInterface(LPDIRECT3DSWAPCHAIN8 iface, REFIID refiid, LPVOID *obj);
589 extern ULONG WINAPI IDirect3DSwapChain8Impl_AddRef(LPDIRECT3DSWAPCHAIN8 iface);
590 extern ULONG WINAPI IDirect3DSwapChain8Impl_Release(LPDIRECT3DSWAPCHAIN8 iface);
592 /* IDirect3DSwapChain8: */
593 extern HRESULT WINAPI IDirect3DSwapChain8Impl_Present(LPDIRECT3DSWAPCHAIN8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion);
594 extern HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer);
597 /* ----------------- */
598 /* IDirect3DSurface8 */
599 /* ----------------- */
601 /*****************************************************************************
602 * Predeclare the interface implementation structures
604 extern ICOM_VTABLE(IDirect3DSurface8) Direct3DSurface8_Vtbl;
606 /*****************************************************************************
607 * IDirect3DSurface8 implementation structure
609 struct IDirect3DSurface8Impl
611 /* IUnknown fields */
612 ICOM_VFIELD(IDirect3DSurface8);
615 /* IDirect3DSurface8 fields */
616 IDirect3DDevice8Impl *Device;
617 D3DRESOURCETYPE ResourceType;
620 D3DSURFACE_DESC myDesc;
621 BYTE *allocatedMemory;
633 extern HRESULT WINAPI IDirect3DSurface8Impl_QueryInterface(LPDIRECT3DSURFACE8 iface,REFIID refiid,LPVOID *obj);
634 extern ULONG WINAPI IDirect3DSurface8Impl_AddRef(LPDIRECT3DSURFACE8 iface);
635 extern ULONG WINAPI IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface);
637 /* IDirect3DSurface8: */
638 extern HRESULT WINAPI IDirect3DSurface8Impl_GetDevice(LPDIRECT3DSURFACE8 iface, IDirect3DDevice8** ppDevice);
639 extern HRESULT WINAPI IDirect3DSurface8Impl_SetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags);
640 extern HRESULT WINAPI IDirect3DSurface8Impl_GetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,void* pData,DWORD* pSizeOfData);
641 extern HRESULT WINAPI IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid);
642 extern HRESULT WINAPI IDirect3DSurface8Impl_GetContainer(LPDIRECT3DSURFACE8 iface, REFIID riid,void** ppContainer);
643 extern HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(LPDIRECT3DSURFACE8 iface, D3DSURFACE_DESC *pDesc);
644 extern HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect,DWORD Flags);
645 extern HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface);
647 /* internal Interfaces */
648 extern HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenum gl_target, GLenum gl_level);
649 extern HRESULT WINAPI IDirect3DSurface8Impl_SaveSnapshot(LPDIRECT3DSURFACE8 iface, const char* filename);
650 extern HRESULT WINAPI IDirect3DSurface8Impl_CleanDirtyRect(LPDIRECT3DSURFACE8 iface);
651 extern HRESULT WINAPI IDirect3DSurface8Impl_AddDirtyRect(LPDIRECT3DSURFACE8 iface, CONST RECT* pDirtyRect);
653 /* ------------------ */
654 /* IDirect3DResource8 */
655 /* ------------------ */
657 /*****************************************************************************
658 * Predeclare the interface implementation structures
660 extern ICOM_VTABLE(IDirect3DResource8) Direct3DResource8_Vtbl;
662 /*****************************************************************************
663 * IDirect3DResource8 implementation structure
665 struct IDirect3DResource8Impl
667 /* IUnknown fields */
668 ICOM_VFIELD(IDirect3DResource8);
671 /* IDirect3DResource8 fields */
672 IDirect3DDevice8Impl *Device;
673 D3DRESOURCETYPE ResourceType;
677 extern HRESULT WINAPI IDirect3DResource8Impl_QueryInterface(LPDIRECT3DRESOURCE8 iface,REFIID refiid,LPVOID *obj);
678 extern ULONG WINAPI IDirect3DResource8Impl_AddRef(LPDIRECT3DRESOURCE8 iface);
679 extern ULONG WINAPI IDirect3DResource8Impl_Release(LPDIRECT3DRESOURCE8 iface);
681 /* IDirect3DResource8: */
682 extern HRESULT WINAPI IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface, IDirect3DDevice8** ppDevice);
683 extern HRESULT WINAPI IDirect3DResource8Impl_SetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
684 extern HRESULT WINAPI IDirect3DResource8Impl_GetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
685 extern HRESULT WINAPI IDirect3DResource8Impl_FreePrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid);
686 extern DWORD WINAPI IDirect3DResource8Impl_SetPriority(LPDIRECT3DRESOURCE8 iface, DWORD PriorityNew);
687 extern DWORD WINAPI IDirect3DResource8Impl_GetPriority(LPDIRECT3DRESOURCE8 iface);
688 extern void WINAPI IDirect3DResource8Impl_PreLoad(LPDIRECT3DRESOURCE8 iface);
689 extern D3DRESOURCETYPE WINAPI IDirect3DResource8Impl_GetType(LPDIRECT3DRESOURCE8 iface);
691 /* internal Interfaces */
692 extern D3DPOOL WINAPI IDirect3DResource8Impl_GetPool(LPDIRECT3DRESOURCE8 iface);
695 /* ---------------------- */
696 /* IDirect3DVertexBuffer8 */
697 /* ---------------------- */
699 /*****************************************************************************
700 * Predeclare the interface implementation structures
702 extern ICOM_VTABLE(IDirect3DVertexBuffer8) Direct3DVertexBuffer8_Vtbl;
704 /*****************************************************************************
705 * IDirect3DVertexBuffer8 implementation structure
707 struct IDirect3DVertexBuffer8Impl
709 /* IUnknown fields */
710 ICOM_VFIELD(IDirect3DVertexBuffer8);
713 /* IDirect3DResource8 fields */
714 IDirect3DDevice8Impl *Device;
715 D3DRESOURCETYPE ResourceType;
717 /* IDirect3DVertexBuffer8 fields */
718 BYTE *allocatedMemory;
719 D3DVERTEXBUFFER_DESC currentDesc;
723 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_QueryInterface(LPDIRECT3DVERTEXBUFFER8 iface,REFIID refiid,LPVOID *obj);
724 extern ULONG WINAPI IDirect3DVertexBuffer8Impl_AddRef(LPDIRECT3DVERTEXBUFFER8 iface);
725 extern ULONG WINAPI IDirect3DVertexBuffer8Impl_Release(LPDIRECT3DVERTEXBUFFER8 iface);
727 /* IDirect3DVertexBuffer8: (Inherited from IDirect3DResource8) */
728 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDevice(LPDIRECT3DVERTEXBUFFER8 iface, IDirect3DDevice8** ppDevice);
729 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
730 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
731 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_FreePrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid);
732 extern DWORD WINAPI IDirect3DVertexBuffer8Impl_SetPriority(LPDIRECT3DVERTEXBUFFER8 iface, DWORD PriorityNew);
733 extern DWORD WINAPI IDirect3DVertexBuffer8Impl_GetPriority(LPDIRECT3DVERTEXBUFFER8 iface);
734 extern void WINAPI IDirect3DVertexBuffer8Impl_PreLoad(LPDIRECT3DVERTEXBUFFER8 iface);
735 extern D3DRESOURCETYPE WINAPI IDirect3DVertexBuffer8Impl_GetType(LPDIRECT3DVERTEXBUFFER8 iface);
737 /* IDirect3DVertexBuffer8: */
738 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_Lock(LPDIRECT3DVERTEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
739 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_Unlock(LPDIRECT3DVERTEXBUFFER8 iface);
740 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8 iface, D3DVERTEXBUFFER_DESC *pDesc);
743 /* --------------------- */
744 /* IDirect3DIndexBuffer8 */
745 /* --------------------- */
747 /*****************************************************************************
748 * Predeclare the interface implementation structures
750 extern ICOM_VTABLE(IDirect3DIndexBuffer8) Direct3DIndexBuffer8_Vtbl;
752 /*****************************************************************************
753 * IDirect3DIndexBuffer8 implementation structure
755 struct IDirect3DIndexBuffer8Impl
757 /* IUnknown fields */
758 ICOM_VFIELD(IDirect3DIndexBuffer8);
761 /* IDirect3DResource8 fields */
762 IDirect3DDevice8Impl *Device;
763 D3DRESOURCETYPE ResourceType;
765 /* IDirect3DIndexBuffer8 fields */
766 void *allocatedMemory;
767 D3DINDEXBUFFER_DESC currentDesc;
771 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_QueryInterface(LPDIRECT3DINDEXBUFFER8 iface,REFIID refiid,LPVOID *obj);
772 extern ULONG WINAPI IDirect3DIndexBuffer8Impl_AddRef(LPDIRECT3DINDEXBUFFER8 iface);
773 extern ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 iface);
775 /* IDirect3DIndexBuffer8: (Inherited from IDirect3DResource8) */
776 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDevice(LPDIRECT3DINDEXBUFFER8 iface, IDirect3DDevice8** ppDevice);
777 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
778 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
779 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid);
780 extern DWORD WINAPI IDirect3DIndexBuffer8Impl_SetPriority(LPDIRECT3DINDEXBUFFER8 iface, DWORD PriorityNew);
781 extern DWORD WINAPI IDirect3DIndexBuffer8Impl_GetPriority(LPDIRECT3DINDEXBUFFER8 iface);
782 extern void WINAPI IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 iface);
783 extern D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer8Impl_GetType(LPDIRECT3DINDEXBUFFER8 iface);
785 /* IDirect3DIndexBuffer8: */
786 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
787 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 iface);
788 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 iface, D3DINDEXBUFFER_DESC *pDesc);
791 /* --------------------- */
792 /* IDirect3DBaseTexture8 */
793 /* --------------------- */
795 /*****************************************************************************
796 * Predeclare the interface implementation structures
798 extern ICOM_VTABLE(IDirect3DBaseTexture8) Direct3DBaseTexture8_Vtbl;
800 /*****************************************************************************
801 * IDirect3DBaseTexture8 implementation structure
803 struct IDirect3DBaseTexture8Impl
805 /* IUnknown fields */
806 ICOM_VFIELD(IDirect3DBaseTexture8);
809 /* IDirect3DResource8 fields */
810 IDirect3DDevice8Impl *Device;
811 D3DRESOURCETYPE ResourceType;
813 /* IDirect3DBaseTexture8 fields */
824 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_QueryInterface(LPDIRECT3DBASETEXTURE8 iface,REFIID refiid,LPVOID *obj);
825 extern ULONG WINAPI IDirect3DBaseTexture8Impl_AddRef(LPDIRECT3DBASETEXTURE8 iface);
826 extern ULONG WINAPI IDirect3DBaseTexture8Impl_Release(LPDIRECT3DBASETEXTURE8 iface);
828 /* IDirect3DBaseTexture8: (Inherited from IDirect3DResource8) */
829 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_GetDevice(LPDIRECT3DBASETEXTURE8 iface, IDirect3DDevice8** ppDevice);
830 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_SetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
831 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_GetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
832 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_FreePrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid);
833 extern DWORD WINAPI IDirect3DBaseTexture8Impl_SetPriority(LPDIRECT3DBASETEXTURE8 iface, DWORD PriorityNew);
834 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetPriority(LPDIRECT3DBASETEXTURE8 iface);
835 extern void WINAPI IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8 iface);
836 extern D3DRESOURCETYPE WINAPI IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8 iface);
838 /* IDirect3DBaseTexture8: */
839 extern DWORD WINAPI IDirect3DBaseTexture8Impl_SetLOD(LPDIRECT3DBASETEXTURE8 iface, DWORD LODNew);
840 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetLOD(LPDIRECT3DBASETEXTURE8 iface);
841 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetLevelCount(LPDIRECT3DBASETEXTURE8 iface);
843 /* internal Interfaces */
844 extern BOOL WINAPI IDirect3DBaseTexture8Impl_IsDirty(LPDIRECT3DBASETEXTURE8 iface);
845 extern BOOL WINAPI IDirect3DBaseTexture8Impl_SetDirty(LPDIRECT3DBASETEXTURE8 iface, BOOL dirty);
848 /* --------------------- */
849 /* IDirect3DCubeTexture8 */
850 /* --------------------- */
852 /*****************************************************************************
853 * Predeclare the interface implementation structures
855 extern ICOM_VTABLE(IDirect3DCubeTexture8) Direct3DCubeTexture8_Vtbl;
857 /*****************************************************************************
858 * IDirect3DCubeTexture8 implementation structure
860 struct IDirect3DCubeTexture8Impl
862 /* IUnknown fields */
863 ICOM_VFIELD(IDirect3DCubeTexture8);
866 /* IDirect3DResource8 fields */
867 IDirect3DDevice8Impl *Device;
868 D3DRESOURCETYPE ResourceType;
870 /* IDirect3DBaseTexture8 fields */
875 /* IDirect3DCubeTexture8 fields */
879 IDirect3DSurface8Impl *surfaces[6][MAX_LEVELS];
883 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_QueryInterface(LPDIRECT3DCUBETEXTURE8 iface,REFIID refiid,LPVOID *obj);
884 extern ULONG WINAPI IDirect3DCubeTexture8Impl_AddRef(LPDIRECT3DCUBETEXTURE8 iface);
885 extern ULONG WINAPI IDirect3DCubeTexture8Impl_Release(LPDIRECT3DCUBETEXTURE8 iface);
887 /* IDirect3DCubeTexture8: (Inherited from IDirect3DResource8) */
888 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetDevice(LPDIRECT3DCUBETEXTURE8 iface, IDirect3DDevice8** ppDevice);
889 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
890 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
891 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_FreePrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid);
892 extern DWORD WINAPI IDirect3DCubeTexture8Impl_SetPriority(LPDIRECT3DCUBETEXTURE8 iface, DWORD PriorityNew);
893 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetPriority(LPDIRECT3DCUBETEXTURE8 iface);
894 extern void WINAPI IDirect3DCubeTexture8Impl_PreLoad(LPDIRECT3DCUBETEXTURE8 iface);
895 extern D3DRESOURCETYPE WINAPI IDirect3DCubeTexture8Impl_GetType(LPDIRECT3DCUBETEXTURE8 iface);
897 /* IDirect3DCubeTexture8: (Inherited from IDirect3DBaseTexture8) */
898 extern DWORD WINAPI IDirect3DCubeTexture8Impl_SetLOD(LPDIRECT3DCUBETEXTURE8 iface, DWORD LODNew);
899 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetLOD(LPDIRECT3DCUBETEXTURE8 iface);
900 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE8 iface);
902 /* IDirect3DCubeTexture8 */
903 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE8 iface, UINT Level, D3DSURFACE_DESC* pDesc);
904 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface8** ppCubeMapSurface);
905 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
906 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level);
907 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect);
910 /* ----------------- */
911 /* IDirect3DTexture8 */
912 /* ----------------- */
914 /*****************************************************************************
915 * Predeclare the interface implementation structures
917 extern ICOM_VTABLE(IDirect3DTexture8) Direct3DTexture8_Vtbl;
919 /*****************************************************************************
920 * IDirect3DTexture8 implementation structure
922 struct IDirect3DTexture8Impl
924 /* IUnknown fields */
925 ICOM_VFIELD(IDirect3DTexture8);
928 /* IDirect3DResourc8 fields */
929 IDirect3DDevice8Impl *Device;
930 D3DRESOURCETYPE ResourceType;
932 /* IDirect3DBaseTexture8 fields */
937 /* IDirect3DTexture8 fields */
942 IDirect3DSurface8Impl *surfaces[MAX_LEVELS];
946 extern HRESULT WINAPI IDirect3DTexture8Impl_QueryInterface(LPDIRECT3DTEXTURE8 iface,REFIID refiid,LPVOID *obj);
947 extern ULONG WINAPI IDirect3DTexture8Impl_AddRef(LPDIRECT3DTEXTURE8 iface);
948 extern ULONG WINAPI IDirect3DTexture8Impl_Release(LPDIRECT3DTEXTURE8 iface);
950 /* IDirect3DTexture8: (Inherited from IDirect3DResource8) */
951 extern HRESULT WINAPI IDirect3DTexture8Impl_GetDevice(LPDIRECT3DTEXTURE8 iface, IDirect3DDevice8** ppDevice);
952 extern HRESULT WINAPI IDirect3DTexture8Impl_SetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
953 extern HRESULT WINAPI IDirect3DTexture8Impl_GetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
954 extern HRESULT WINAPI IDirect3DTexture8Impl_FreePrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid);
955 extern DWORD WINAPI IDirect3DTexture8Impl_SetPriority(LPDIRECT3DTEXTURE8 iface, DWORD PriorityNew);
956 extern DWORD WINAPI IDirect3DTexture8Impl_GetPriority(LPDIRECT3DTEXTURE8 iface);
957 extern void WINAPI IDirect3DTexture8Impl_PreLoad(LPDIRECT3DTEXTURE8 iface);
958 extern D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(LPDIRECT3DTEXTURE8 iface);
960 /* IDirect3DTexture8: (Inherited from IDirect3DBaseTexture8) */
961 extern DWORD WINAPI IDirect3DTexture8Impl_SetLOD(LPDIRECT3DTEXTURE8 iface, DWORD LODNew);
962 extern DWORD WINAPI IDirect3DTexture8Impl_GetLOD(LPDIRECT3DTEXTURE8 iface);
963 extern DWORD WINAPI IDirect3DTexture8Impl_GetLevelCount(LPDIRECT3DTEXTURE8 iface);
965 /* IDirect3DTexture8: */
966 extern HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(LPDIRECT3DTEXTURE8 iface, UINT Level, D3DSURFACE_DESC* pDesc);
967 extern HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE8 iface, UINT Level, IDirect3DSurface8** ppSurfaceLevel);
968 extern HRESULT WINAPI IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
969 extern HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(LPDIRECT3DTEXTURE8 iface, UINT Level);
970 extern HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(LPDIRECT3DTEXTURE8 iface, CONST RECT* pDirtyRect);
973 /* ----------------------- */
974 /* IDirect3DVolumeTexture8 */
975 /* ----------------------- */
977 /*****************************************************************************
978 * Predeclare the interface implementation structures
980 extern ICOM_VTABLE(IDirect3DVolumeTexture8) Direct3DVolumeTexture8_Vtbl;
982 /*****************************************************************************
983 * IDirect3DVolumeTexture8 implementation structure
985 struct IDirect3DVolumeTexture8Impl
987 /* IUnknown fields */
988 ICOM_VFIELD(IDirect3DVolumeTexture8);
991 /* IDirect3DResource8 fields */
992 IDirect3DDevice8Impl *Device;
993 D3DRESOURCETYPE ResourceType;
995 /* IDirect3DBaseTexture8 fields */
1000 /* IDirect3DVolumeTexture8 fields */
1006 IDirect3DVolume8Impl *volumes[MAX_LEVELS];
1010 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE8 iface,REFIID refiid,LPVOID *obj);
1011 extern ULONG WINAPI IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8 iface);
1012 extern ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8 iface);
1014 /* IDirect3DVolumeTexture8: (Inherited from IDirect3DResource8) */
1015 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE8 iface, IDirect3DDevice8** ppDevice);
1016 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
1017 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
1018 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid);
1019 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD PriorityNew);
1020 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE8 iface);
1021 extern void WINAPI IDirect3DVolumeTexture8Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE8 iface);
1022 extern D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture8Impl_GetType(LPDIRECT3DVOLUMETEXTURE8 iface);
1024 /* IDirect3DVolumeTexture8: (Inherited from IDirect3DBaseTexture8) */
1025 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD LODNew);
1026 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE8 iface);
1027 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE8 iface);
1029 /* IDirect3DVolumeTexture8: */
1030 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DVOLUME_DESC *pDesc);
1031 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, IDirect3DVolume8** ppVolumeLevel);
1032 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
1033 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level);
1034 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE8 iface, CONST D3DBOX* pDirtyBox);
1037 /* ==============================================================================
1038 Private interfactes: beginning of cleaning/splitting for HAL and d3d9 support
1039 ============================================================================== */
1041 /* State Block for Begin/End/Capture/Create/Apply State Block */
1042 /* Note: Very long winded but I do not believe gl Lists will */
1043 /* resolve everything we need, so doing it manually for now */
1044 typedef struct SAVEDSTATES {
1047 BOOL stream_source[MAX_STREAMS];
1049 BOOL transform[HIGHEST_TRANSFORMSTATE];
1052 BOOL vertexShaderConstant;
1053 BOOL vertexShaderDecl;
1055 BOOL pixelShaderConstant;
1056 BOOL renderstate[HIGHEST_RENDER_STATE];
1057 BOOL texture_state[8][HIGHEST_TEXTURE_STATE];
1058 BOOL clipplane[MAX_CLIPPLANES];
1062 /* ----------------------- */
1063 /* IDirect3DStateBlockImpl */
1064 /* ----------------------- */
1066 /*****************************************************************************
1067 * Predeclare the interface implementation structures
1069 /*extern ICOM_VTABLE(IDirect3DStateBlock9) Direct3DStateBlock9_Vtbl;*/
1071 /*****************************************************************************
1072 * IDirect3DStateBlock implementation structure
1074 struct IDirect3DStateBlockImpl {
1075 /* IUnknown fields */
1076 /*ICOM_VFIELD(IDirect3DStateBlock9);*/
1079 /* The device, to be replaced by a IDirect3DDeviceImpl */
1080 IDirect3DDevice8Impl* device;
1082 D3DSTATEBLOCKTYPE blockType;
1084 SAVEDSTATES Changed;
1088 double clipplane[MAX_CLIPPLANES][4];
1091 UINT stream_stride[MAX_STREAMS];
1092 IDirect3DVertexBuffer8 *stream_source[MAX_STREAMS];
1096 IDirect3DIndexBuffer8* pIndexData;
1097 UINT baseVertexIndex;
1100 IDirect3DBaseTexture8 *textures[8];
1101 int textureDimensions[8];
1102 /* Texture State Stage */
1103 DWORD texture_state[8][HIGHEST_TEXTURE_STATE];
1106 PLIGHTINFOEL *lights; /* NOTE: active GL lights must be front of the chain */
1109 D3DMATERIAL8 material;
1112 DWORD renderstate[HIGHEST_RENDER_STATE];
1115 D3DMATRIX transforms[HIGHEST_TRANSFORMSTATE];
1118 D3DVIEWPORT8 viewport;
1123 /* Vertex Shader Declaration */
1124 IDirect3DVertexShaderDeclarationImpl* vertexShaderDecl;
1129 /* Indexed Vertex Blending */
1130 D3DVERTEXBLENDFLAGS vertex_blend;
1133 /* Vertex Shader Constant */
1134 D3DSHADERVECTOR vertexShaderConstant[D3D8_VSHADER_MAX_CONSTANTS];
1135 /* Pixel Shader Constant */
1136 D3DSHADERVECTOR pixelShaderConstant[D3D8_PSHADER_MAX_CONSTANTS];
1139 /* exported Interfaces */
1140 /* internal Interfaces */
1141 /* temporary internal Interfaces */
1142 extern HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* This);
1143 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateStateBlock(IDirect3DDevice8Impl* This, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlockImpl** ppStateBlock);
1144 extern HRESULT WINAPI IDirect3DDeviceImpl_DeleteStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl* pSB);
1145 extern HRESULT WINAPI IDirect3DDeviceImpl_BeginStateBlock(IDirect3DDevice8Impl* This);
1146 extern HRESULT WINAPI IDirect3DDeviceImpl_EndStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl** ppStateBlock);
1147 extern HRESULT WINAPI IDirect3DDeviceImpl_ApplyStateBlock(IDirect3DDevice8Impl* iface, IDirect3DStateBlockImpl* pSB);
1148 extern HRESULT WINAPI IDirect3DDeviceImpl_CaptureStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl* pSB);
1150 /* ------------------------------------ */
1151 /* IDirect3DVertexShaderDeclarationImpl */
1152 /* ------------------------------------ */
1154 /*****************************************************************************
1155 * Predeclare the interface implementation structures
1157 /*extern ICOM_VTABLE(IDirect3DVertexShaderDeclaration9) Direct3DVertexShaderDeclaration9_Vtbl;*/
1159 /*****************************************************************************
1160 * IDirect3DVertexShaderDeclaration implementation structure
1162 struct IDirect3DVertexShaderDeclarationImpl {
1163 /* IUnknown fields */
1164 /*ICOM_VFIELD(IDirect3DVertexShaderDeclaration9);*/
1167 /* The device, to be replaced by a IDirect3DDeviceImpl */
1168 IDirect3DDevice8Impl* device;
1170 /** precomputed fvf if simple declaration */
1171 DWORD fvf[MAX_STREAMS];
1174 /** dx8 compatible Declaration fields */
1175 DWORD* pDeclaration8;
1176 DWORD declaration8Length;
1179 /* exported Interfaces */
1180 extern HRESULT WINAPI IDirect3DVertexShaderDeclarationImpl_GetDeclaration8(IDirect3DVertexShaderDeclarationImpl* This, DWORD* pData, UINT* pSizeOfData);
1181 /*extern HRESULT IDirect3DVertexShaderDeclarationImpl_GetDeclaration9(IDirect3DVertexShaderDeclarationImpl* This, D3DVERTEXELEMENT9* pData, UINT* pNumElements);*/
1182 /* internal Interfaces */
1183 /* temporary internal Interfaces */
1184 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateVertexShaderDeclaration8(IDirect3DDevice8Impl* This, CONST DWORD* pDeclaration8, IDirect3DVertexShaderDeclarationImpl** ppVertexShaderDecl);
1187 /* ------------------------- */
1188 /* IDirect3DVertexShaderImpl */
1189 /* ------------------------- */
1191 /*****************************************************************************
1192 * Predeclare the interface implementation structures
1194 /*extern ICOM_VTABLE(IDirect3DVertexShader9) Direct3DVertexShader9_Vtbl;*/
1196 /*****************************************************************************
1197 * IDirect3DVertexShader implementation structure
1199 struct IDirect3DVertexShaderImpl {
1200 /*ICOM_VFIELD(IDirect3DVertexShader9);*/
1203 /* The device, to be replaced by a IDirect3DDeviceImpl */
1204 IDirect3DDevice8Impl* device;
1207 UINT functionLength;
1208 DWORD usage; /* 0 || D3DUSAGE_SOFTWAREPROCESSING */
1211 /** fields for hw vertex shader use */
1214 /* run time datas */
1216 VSHADERINPUTDATA8 input;
1217 VSHADEROUTPUTDATA8 output;
1220 /* exported Interfaces */
1221 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetFunction(IDirect3DVertexShaderImpl* This, VOID* pData, UINT* pSizeOfData);
1222 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);*/
1223 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST INT* pConstantData, UINT Vector4iCount);*/
1224 extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount);
1225 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);*/
1226 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, INT* pConstantData, UINT Vector4iCount);*/
1227 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, FLOAT* pConstantData, UINT Vector4fCount);
1228 /* internal Interfaces */
1229 extern DWORD WINAPI IDirect3DVertexShaderImpl_GetVersion(IDirect3DVertexShaderImpl* This);
1230 extern HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* This, VSHADERINPUTDATA8* input, VSHADEROUTPUTDATA8* output);
1231 /* temporary internal Interfaces */
1232 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateVertexShader(IDirect3DDevice8Impl* This, CONST DWORD* pFunction, DWORD Usage, IDirect3DVertexShaderImpl** ppVertexShader);
1233 extern HRESULT WINAPI IDirect3DDeviceImpl_FillVertexShaderInputSW(IDirect3DDevice8Impl* This, IDirect3DVertexShaderImpl* vshader, DWORD SkipnStrides);
1234 extern HRESULT WINAPI IDirect3DDeviceImpl_FillVertexShaderInputArbHW(IDirect3DDevice8Impl* This, IDirect3DVertexShaderImpl* vshader, DWORD SkipnStrides);
1236 /* ------------------------ */
1237 /* IDirect3DPixelShaderImpl */
1238 /* ------------------------ */
1240 /*****************************************************************************
1241 * Predeclare the interface implementation structures
1243 /*extern ICOM_VTABLE(IDirect3DPixelShader9) Direct3DPixelShader9_Vtbl;*/
1245 /*****************************************************************************
1246 * IDirect3DPixelShader implementation structure
1248 struct IDirect3DPixelShaderImpl {
1249 /*ICOM_VFIELD(IDirect3DPixelShader9);*/
1252 /* The device, to be replaced by a IDirect3DDeviceImpl */
1253 IDirect3DDevice8Impl* device;
1256 UINT functionLength;
1258 /* run time datas */
1260 PSHADERINPUTDATA8 input;
1261 PSHADEROUTPUTDATA8 output;
1264 /* exported Interfaces */
1265 extern HRESULT WINAPI IDirect3DPixelShaderImpl_GetFunction(IDirect3DPixelShaderImpl* This, VOID* pData, UINT* pSizeOfData);
1266 /* internal Interfaces */
1267 extern DWORD WINAPI IDirect3DPixelShaderImpl_GetVersion(IDirect3DPixelShaderImpl* This);
1268 /* temporary internal Interfaces */
1269 extern HRESULT WINAPI IDirect3DDeviceImpl_CreatePixelShader(IDirect3DDevice8Impl* This, CONST DWORD* pFunction, IDirect3DPixelShaderImpl** ppPixelShader);
1273 * Internals functions
1275 * to see how not defined it here
1277 void GetSrcAndOpFromValue(DWORD iValue, BOOL isAlphaArg, GLenum* source, GLenum* operand);
1278 void setupTextureStates(LPDIRECT3DDEVICE8 iface, DWORD Stage, DWORD Flags);
1279 void set_tex_op(LPDIRECT3DDEVICE8 iface, BOOL isAlpha, int Stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3);
1281 SHORT D3DFmtGetBpp(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1282 GLint D3DFmt2GLIntFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1283 GLenum D3DFmt2GLFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1284 GLenum D3DFmt2GLType(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1286 GLenum D3DFmt2GLDepthFmt(D3DFORMAT fmt);
1287 GLenum D3DFmt2GLDepthType(D3DFORMAT fmt);
1289 int D3DPrimitiveListGetVertexSize(D3DPRIMITIVETYPE PrimitiveType, int iNumPrim);
1290 int D3DPrimitive2GLenum(D3DPRIMITIVETYPE PrimitiveType);
1291 int D3DFVFGetSize(D3DFORMAT fvf);
1293 int SOURCEx_RGB_EXT(DWORD arg);
1294 int OPERANDx_RGB_EXT(DWORD arg);
1295 int SOURCEx_ALPHA_EXT(DWORD arg);
1296 int OPERANDx_ALPHA_EXT(DWORD arg);
1297 GLenum StencilOp(DWORD op);
1300 * Internals debug functions
1302 const char* debug_d3ddevicetype(D3DDEVTYPE devtype);
1303 const char* debug_d3dusage(DWORD usage);
1304 const char* debug_d3dformat(D3DFORMAT fmt);
1305 const char* debug_d3dressourcetype(D3DRESOURCETYPE res);
1306 const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType);
1307 const char* debug_d3dpool(D3DPOOL Pool);
1308 const char *debug_d3drenderstate(DWORD State);
1309 const char *debug_d3dtexturestate(DWORD State);
1311 /* Some #defines for additional diagnostics */
1312 #if 0 /* NOTE: Must be 0 in cvs */
1313 /* To avoid having to get gigabytes of trace, the following can be compiled in, and at the start
1314 of each frame, a check is made for the existence of C:\D3DTRACE, and if if exists d3d trace
1315 is enabled, and if it doesn't exists it is disabled. */
1316 # define FRAME_DEBUGGING
1317 /* Adding in the SINGLE_FRAME_DEBUGGING gives a trace of just what makes up a single frame, before
1318 the file is deleted */
1319 # if 1 /* NOTE: Must be 1 in cvs, as this is mostly more useful than a trace from program start */
1320 # define SINGLE_FRAME_DEBUGGING
1322 /* The following, when enabled, lets you see the makeup of the frame, by drawprimitive calls.
1323 It can only be enabled when FRAME_DEBUGGING is also enabled
1324 The contents of the back buffer are written into /tmp/backbuffer_* after each primitive
1326 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
1327 # define SHOW_FRAME_MAKEUP 1
1329 /* The following, when enabled, lets you see the makeup of the all the textures used during each
1330 of the drawprimitive calls. It can only be enabled when SHOW_FRAME_MAKEUP is also enabled.
1331 The contents of the textures assigned to each stage are written into
1332 /tmp/texture_*_<Stage>.ppm after each primitive array is drawn. */
1333 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
1334 # define SHOW_TEXTURE_MAKEUP 0
1337 extern BOOL isDumpingFrames;
1338 extern LONG primCounter;
1341 /* Per-vertex trace: */
1342 #if 0 /* NOTE: Must be 0 in cvs */
1343 # define VTRACE(A) TRACE A
1348 #define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w);
1349 #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);
1351 #define DUMP_LIGHT_CHAIN() \
1353 PLIGHTINFOEL *el = This->StateBlock->lights;\
1355 TRACE("Light %p (glIndex %ld, d3dIndex %ld, enabled %d)\n", el, el->glIndex, el->OriginalIndex, el->lightEnabled);\
1360 #endif /* __WINE_D3DX8_PRIVATE_H */