2 * Direct3D 8 private include file
4 * Copyright 2002 Jason Edmeades
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_D3D8_PRIVATE_H
22 #define __WINE_D3D8_PRIVATE_H
24 #ifndef __WINE_CONFIG_H
25 # error You must include config.h to use this header
28 /* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES */
29 #define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */
32 #ifdef HAVE_GL_GLEXT_H
33 # include <GL/glext.h>
41 /* Redefines the constants */
42 #define CALLBACK __stdcall
43 #define WINAPI __stdcall
44 #define APIENTRY WINAPI
48 extern void (*wine_tsx11_lock_ptr)(void);
49 extern void (*wine_tsx11_unlock_ptr)(void);
51 /* As GLX relies on X, this is needed */
54 #define ENTER_GL() ++num_lock; TRACE("inc lock to: %d\n", num_lock); wine_tsx11_lock_ptr()
55 #define LEAVE_GL() if (num_lock > 2) TRACE("fucking locks: %d\n", num_lock); --num_lock; wine_tsx11_unlock_ptr()
57 #define ENTER_GL() wine_tsx11_lock_ptr()
58 #define LEAVE_GL() wine_tsx11_unlock_ptr()
68 #define MAX_PALETTES 256
69 #define MAX_STREAMS 16
70 #define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
71 #define MAX_LEVELS 256
73 /* Other useful values */
74 #define HIGHEST_RENDER_STATE 174
75 #define HIGHEST_TEXTURE_STATE 29
76 #define HIGHEST_TRANSFORMSTATE 512
77 #define D3DSBT_RECORDED 0xfffffffe
79 /* Performance changes - Only reapply what is necessary */
80 #define REAPPLY_ALPHAOP 0x0001
81 #define REAPPLY_ALL 0xFFFF
83 /* CreateVertexShader can return > 0xFFFF */
84 #define VS_HIGHESTFIXEDFXF 0xF0000000
85 #define VERTEX_SHADER(Handle) \
86 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(VertexShaders) / sizeof(IDirect3DVertexShaderImpl*)) ? NULL : VertexShaders[Handle]) : VertexShaders[Handle - VS_HIGHESTFIXEDFXF])
87 #define VERTEX_SHADER_DECL(Handle) \
88 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(VertexShaderDeclarations) / sizeof(IDirect3DVertexShaderDeclarationImpl*)) ? NULL : VertexShaderDeclarations[Handle]) : VertexShaderDeclarations[Handle - VS_HIGHESTFIXEDFXF])
89 #define PIXEL_SHADER(Handle) \
90 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(PixelShaders) / sizeof(IDirect3DPixelShaderImpl*)) ? NULL : PixelShaders[Handle]) : PixelShaders[Handle - VS_HIGHESTFIXEDFXF])
92 /* Direct3D8 Interfaces: */
93 typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
94 typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
95 typedef struct IDirect3D8Impl IDirect3D8Impl;
96 typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
97 typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
98 typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
99 typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
100 typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
101 typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
102 typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
103 typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
104 typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
106 /** Private Interfaces: */
107 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
108 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
109 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
110 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
112 typedef struct D3DSHADERVECTOR {
119 typedef struct D3DSHADERSCALAR {
123 #define D3D8_VSHADER_MAX_CONSTANTS 96
124 typedef D3DSHADERVECTOR VSHADERCONSTANTS8[D3D8_VSHADER_MAX_CONSTANTS];
126 typedef struct VSHADERDATA8 {
127 /** Run Time Shader Function Constants */
128 /*D3DXBUFFER* constants;*/
130 /** Shader Code as char ... */
135 /** temporary here waiting for buffer code */
136 typedef struct VSHADERINPUTDATA8 {
137 D3DSHADERVECTOR V[17];
140 /** temporary here waiting for buffer code */
141 typedef struct VSHADEROUTPUTDATA8 {
142 D3DSHADERVECTOR oPos;
143 D3DSHADERVECTOR oD[2];
144 D3DSHADERVECTOR oT[8];
145 D3DSHADERVECTOR oFog;
146 D3DSHADERVECTOR oPts;
147 } VSHADEROUTPUTDATA8;
150 #define D3D8_PSHADER_MAX_CONSTANTS 32
151 typedef D3DSHADERVECTOR PSHADERCONSTANTS8[D3D8_PSHADER_MAX_CONSTANTS];
153 typedef struct PSHADERDATA8 {
154 /** Run Time Shader Function Constants */
155 /*D3DXBUFFER* constants;*/
157 /** Shader Code as char ... */
162 /** temporary here waiting for buffer code */
163 typedef struct PSHADERINPUTDATA8 {
164 D3DSHADERVECTOR V[2];
165 D3DSHADERVECTOR T[8];
166 D3DSHADERVECTOR S[16];
167 /*D3DSHADERVECTOR R[12];*/
170 /** temporary here waiting for buffer code */
171 typedef struct PSHADEROUTPUTDATA8 {
172 D3DSHADERVECTOR oC[4];
173 D3DSHADERVECTOR oDepth;
174 } PSHADEROUTPUTDATA8;
177 * Private definitions for internal use only
179 typedef struct PLIGHTINFOEL PLIGHTINFOEL;
180 struct PLIGHTINFOEL {
181 D3DLIGHT8 OriginalParms;
188 /* Converted parms to speed up swapping lights */
201 #define checkGLcall(A) \
203 GLint err = glGetError(); \
204 if (err != GL_NO_ERROR) { \
205 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
207 TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \
210 #define vcheckGLcall(A) \
212 GLint err = glGetError(); \
213 if (err != GL_NO_ERROR) { \
214 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
216 VTRACE(("%s call ok %s / %d\n", A, __FILE__, __LINE__)); \
220 #include "d3dcore_gl.h"
223 #define GL_LIMITS(ExtName) (This->direct3d8->gl_info.max_##ExtName)
224 #define GL_SUPPORT(ExtName) (TRUE == This->direct3d8->gl_info.supported[ExtName])
225 #define GL_SUPPORT_DEV(ExtName, dev) (TRUE == (dev)->direct3d8->gl_info.supported[ExtName])
226 #define GL_EXTCALL(FuncName) (This->direct3d8->gl_info.FuncName)
229 #define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f)
230 #define D3DCOLOR_G(dw) (((float) (((dw) >> 8) & 0xFF)) / 255.0f)
231 #define D3DCOLOR_B(dw) (((float) (((dw) >> 0) & 0xFF)) / 255.0f)
232 #define D3DCOLOR_A(dw) (((float) (((dw) >> 24) & 0xFF)) / 255.0f)
234 #define D3DCOLORTOCOLORVALUE(dw, col) \
235 (col).r = D3DCOLOR_R(dw); \
236 (col).g = D3DCOLOR_G(dw); \
237 (col).b = D3DCOLOR_B(dw); \
238 (col).a = D3DCOLOR_A(dw);
240 #define D3DCOLORTOVECTOR4(dw, vec) \
241 (vec).x = D3DCOLOR_R(dw); \
242 (vec).y = D3DCOLOR_G(dw); \
243 (vec).z = D3DCOLOR_B(dw); \
244 (vec).w = D3DCOLOR_A(dw);
246 #define D3DCOLORTOGLFLOAT4(dw, vec) \
247 (vec)[0] = D3DCOLOR_R(dw); \
248 (vec)[1] = D3DCOLOR_G(dw); \
249 (vec)[2] = D3DCOLOR_B(dw); \
250 (vec)[3] = D3DCOLOR_A(dw);
252 /* ===========================================================================
253 The interfactes themselves
254 =========================================================================== */
260 /*****************************************************************************
261 * Predeclare the interface implementation structures
263 extern ICOM_VTABLE(IDirect3D8) Direct3D8_Vtbl;
265 /*****************************************************************************
266 * IDirect3D implementation structure
268 struct IDirect3D8Impl
270 /* IUnknown fields */
271 ICOM_VFIELD(IDirect3D8);
274 /* IDirect3D8 fields */
277 IDirect3D8Impl *direct3d8;
281 extern HRESULT WINAPI IDirect3D8Impl_QueryInterface(LPDIRECT3D8 iface,REFIID refiid,LPVOID *obj);
282 extern ULONG WINAPI IDirect3D8Impl_AddRef(LPDIRECT3D8 iface);
283 extern ULONG WINAPI IDirect3D8Impl_Release(LPDIRECT3D8 iface);
286 extern HRESULT WINAPI IDirect3D8Impl_RegisterSoftwareDevice(LPDIRECT3D8 iface, void* pInitializeFunction);
287 extern UINT WINAPI IDirect3D8Impl_GetAdapterCount(LPDIRECT3D8 iface);
288 extern HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier(LPDIRECT3D8 iface, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER8* pIdentifier);
289 extern UINT WINAPI IDirect3D8Impl_GetAdapterModeCount(LPDIRECT3D8 iface, UINT Adapter);
290 extern HRESULT WINAPI IDirect3D8Impl_EnumAdapterModes(LPDIRECT3D8 iface, UINT Adapter, UINT Mode, D3DDISPLAYMODE* pMode);
291 extern HRESULT WINAPI IDirect3D8Impl_GetAdapterDisplayMode(LPDIRECT3D8 iface, UINT Adapter, D3DDISPLAYMODE* pMode);
292 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceType(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat,
293 D3DFORMAT BackBufferFormat, BOOL Windowed);
294 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
295 DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
296 extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceMultiSampleType(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat,
297 BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType);
298 extern HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
299 D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
300 extern HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps);
301 extern HMONITOR WINAPI IDirect3D8Impl_GetAdapterMonitor(LPDIRECT3D8 iface, UINT Adapter);
302 extern HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
303 DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
304 IDirect3DDevice8** ppReturnedDeviceInterface);
306 /* ---------------- */
307 /* IDirect3DDevice8 */
308 /* ---------------- */
310 /*****************************************************************************
311 * Predeclare the interface implementation structures
313 extern ICOM_VTABLE(IDirect3DDevice8) Direct3DDevice8_Vtbl;
315 /*****************************************************************************
316 * IDirect3DDevice8 implementation structure
318 struct IDirect3DDevice8Impl
320 /* IUnknown fields */
321 ICOM_VFIELD(IDirect3DDevice8);
324 /* IDirect3DDevice8 fields */
325 IDirect3D8Impl *direct3d8;
327 IDirect3DSurface8Impl *frontBuffer;
328 IDirect3DSurface8Impl *backBuffer;
329 IDirect3DSurface8Impl *depthStencilBuffer;
331 IDirect3DSurface8Impl *renderTarget;
332 IDirect3DSurface8Impl *stencilBufferTarget;
334 D3DPRESENT_PARAMETERS PresentParms;
335 D3DDEVICE_CREATION_PARAMETERS CreateParms;
345 /* State block related */
346 BOOL isRecordingState;
347 IDirect3DStateBlockImpl *StateBlock;
348 IDirect3DStateBlockImpl *UpdateStateBlock;
350 /* palettes texture management */
351 PALETTEENTRY palettes[MAX_PALETTES][256];
355 BOOL modelview_valid;
357 BOOL view_ident; /* true iff view matrix is identity */
358 BOOL last_was_rhw; /* true iff last draw_primitive was in xyzrhw mode */
359 GLenum tracking_parm; /* Which source is tracking current colour */
360 LONG tracking_color; /* used iff GL_COLOR_MATERIAL was enabled */
361 #define DISABLED_TRACKING 0 /* Disabled */
362 #define IS_TRACKING 1 /* tracking_parm is tracking diffuse color */
363 #define NEEDS_TRACKING 2 /* Tracking needs to be enabled when needed */
364 #define NEEDS_DISABLE 3 /* Tracking needs to be disabled when needed*/
368 XVisualInfo *visInfo;
372 GLXContext render_ctx;
374 GLint maxConcurrentLights;
376 /* OpenGL Extension related */
378 /* Cursor management */
386 UINT dummyTextureName[8];
390 extern HRESULT WINAPI IDirect3DDevice8Impl_QueryInterface(LPDIRECT3DDEVICE8 iface, REFIID refiid, LPVOID *obj);
391 extern ULONG WINAPI IDirect3DDevice8Impl_AddRef(LPDIRECT3DDEVICE8 iface);
392 extern ULONG WINAPI IDirect3DDevice8Impl_Release(LPDIRECT3DDEVICE8 iface);
394 /* IDirect3DDevice8: */
395 extern HRESULT WINAPI IDirect3DDevice8Impl_TestCooperativeLevel(LPDIRECT3DDEVICE8 iface);
396 extern UINT WINAPI IDirect3DDevice8Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE8 iface);
397 extern HRESULT WINAPI IDirect3DDevice8Impl_ResourceManagerDiscardBytes(LPDIRECT3DDEVICE8 iface, DWORD Bytes);
398 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDirect3D(LPDIRECT3DDEVICE8 iface, IDirect3D8** ppD3D8);
399 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDeviceCaps(LPDIRECT3DDEVICE8 iface, D3DCAPS8* pCaps);
400 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDisplayMode(LPDIRECT3DDEVICE8 iface, D3DDISPLAYMODE* pMode);
401 extern HRESULT WINAPI IDirect3DDevice8Impl_GetCreationParameters(LPDIRECT3DDEVICE8 iface, D3DDEVICE_CREATION_PARAMETERS* pParameters);
402 extern HRESULT WINAPI IDirect3DDevice8Impl_SetCursorProperties(LPDIRECT3DDEVICE8 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8* pCursorBitmap);
403 extern void WINAPI IDirect3DDevice8Impl_SetCursorPosition(LPDIRECT3DDEVICE8 iface, UINT XScreenSpace, UINT YScreenSpace, DWORD Flags);
404 extern BOOL WINAPI IDirect3DDevice8Impl_ShowCursor(LPDIRECT3DDEVICE8 iface, BOOL bShow);
405 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain8** pSwapChain);
406 extern HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters);
407 extern HRESULT WINAPI IDirect3DDevice8Impl_Present(LPDIRECT3DDEVICE8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion);
408 extern HRESULT WINAPI IDirect3DDevice8Impl_GetBackBuffer(LPDIRECT3DDEVICE8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface8** ppBackBuffer);
409 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRasterStatus(LPDIRECT3DDEVICE8 iface, D3DRASTER_STATUS* pRasterStatus);
410 extern void WINAPI IDirect3DDevice8Impl_SetGammaRamp(LPDIRECT3DDEVICE8 iface, DWORD Flags, CONST D3DGAMMARAMP* pRamp);
411 extern void WINAPI IDirect3DDevice8Impl_GetGammaRamp(LPDIRECT3DDEVICE8 iface, D3DGAMMARAMP* pRamp);
412 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture8** ppTexture);
413 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture8** ppVolumeTexture);
414 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 iface, UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture8** ppCubeTexture);
415 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer8** ppVertexBuffer);
416 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer8** ppIndexBuffer);
417 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateRenderTarget(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, BOOL Lockable, IDirect3DSurface8** ppSurface);
418 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, IDirect3DSurface8** ppSurface);
419 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateImageSurface(LPDIRECT3DDEVICE8 iface, UINT Width, UINT Height, D3DFORMAT Format, IDirect3DSurface8** ppSurface);
420 extern HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pSourceSurface, CONST RECT* pSourceRectsArray, UINT cRects, IDirect3DSurface8* pDestinationSurface, CONST POINT* pDestPointsArray);
421 extern HRESULT WINAPI IDirect3DDevice8Impl_UpdateTexture(LPDIRECT3DDEVICE8 iface, IDirect3DBaseTexture8* pSourceTexture, IDirect3DBaseTexture8* pDestinationTexture);
422 extern HRESULT WINAPI IDirect3DDevice8Impl_GetFrontBuffer(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pDestSurface);
423 extern HRESULT WINAPI IDirect3DDevice8Impl_SetRenderTarget(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pRenderTarget, IDirect3DSurface8* pNewZStencil);
424 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRenderTarget(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8** ppRenderTarget);
425 extern HRESULT WINAPI IDirect3DDevice8Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8** ppZStencilSurface);
426 extern HRESULT WINAPI IDirect3DDevice8Impl_BeginScene(LPDIRECT3DDEVICE8 iface);
427 extern HRESULT WINAPI IDirect3DDevice8Impl_EndScene(LPDIRECT3DDEVICE8 iface);
428 extern HRESULT WINAPI IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface, DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil);
429 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
430 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix);
431 extern HRESULT WINAPI IDirect3DDevice8Impl_MultiplyTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
432 extern HRESULT WINAPI IDirect3DDevice8Impl_SetViewport(LPDIRECT3DDEVICE8 iface, CONST D3DVIEWPORT8* pViewport);
433 extern HRESULT WINAPI IDirect3DDevice8Impl_GetViewport(LPDIRECT3DDEVICE8 iface, D3DVIEWPORT8* pViewport);
434 extern HRESULT WINAPI IDirect3DDevice8Impl_SetMaterial(LPDIRECT3DDEVICE8 iface, CONST D3DMATERIAL8* pMaterial);
435 extern HRESULT WINAPI IDirect3DDevice8Impl_GetMaterial(LPDIRECT3DDEVICE8 iface, D3DMATERIAL8* pMaterial);
436 extern HRESULT WINAPI IDirect3DDevice8Impl_SetLight(LPDIRECT3DDEVICE8 iface, DWORD Index, CONST D3DLIGHT8* pLight);
437 extern HRESULT WINAPI IDirect3DDevice8Impl_GetLight(LPDIRECT3DDEVICE8 iface, DWORD Index, D3DLIGHT8* pLight);
438 extern HRESULT WINAPI IDirect3DDevice8Impl_LightEnable(LPDIRECT3DDEVICE8 iface, DWORD Index, BOOL Enable);
439 extern HRESULT WINAPI IDirect3DDevice8Impl_GetLightEnable(LPDIRECT3DDEVICE8 iface, DWORD Index, BOOL* pEnable);
440 extern HRESULT WINAPI IDirect3DDevice8Impl_SetClipPlane(LPDIRECT3DDEVICE8 iface, DWORD Index, CONST float* pPlane);
441 extern HRESULT WINAPI IDirect3DDevice8Impl_GetClipPlane(LPDIRECT3DDEVICE8 iface, DWORD Index, float* pPlane);
442 extern HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3DRENDERSTATETYPE State, DWORD Value);
443 extern HRESULT WINAPI IDirect3DDevice8Impl_GetRenderState(LPDIRECT3DDEVICE8 iface, D3DRENDERSTATETYPE State, DWORD* pValue);
444 extern HRESULT WINAPI IDirect3DDevice8Impl_BeginStateBlock(LPDIRECT3DDEVICE8 iface);
445 extern HRESULT WINAPI IDirect3DDevice8Impl_EndStateBlock(LPDIRECT3DDEVICE8 iface, DWORD* pToken);
446 extern HRESULT WINAPI IDirect3DDevice8Impl_ApplyStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
447 extern HRESULT WINAPI IDirect3DDevice8Impl_CaptureStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
448 extern HRESULT WINAPI IDirect3DDevice8Impl_DeleteStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
449 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(LPDIRECT3DDEVICE8 iface, D3DSTATEBLOCKTYPE Type,DWORD* pToken);
450 extern HRESULT WINAPI IDirect3DDevice8Impl_SetClipStatus(LPDIRECT3DDEVICE8 iface, CONST D3DCLIPSTATUS8* pClipStatus);
451 extern HRESULT WINAPI IDirect3DDevice8Impl_GetClipStatus(LPDIRECT3DDEVICE8 iface, D3DCLIPSTATUS8* pClipStatus);
452 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage, IDirect3DBaseTexture8** ppTexture);
453 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage, IDirect3DBaseTexture8* pTexture);
454 extern HRESULT WINAPI IDirect3DDevice8Impl_GetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue);
455 extern HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
456 extern HRESULT WINAPI IDirect3DDevice8Impl_ValidateDevice(LPDIRECT3DDEVICE8 iface, DWORD* pNumPasses);
457 extern HRESULT WINAPI IDirect3DDevice8Impl_GetInfo(LPDIRECT3DDEVICE8 iface, DWORD DevInfoID, void* pDevInfoStruct, DWORD DevInfoStructSize);
458 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPaletteEntries(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries);
459 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPaletteEntries(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber, PALETTEENTRY* pEntries);
460 extern HRESULT WINAPI IDirect3DDevice8Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber);
461 extern HRESULT WINAPI IDirect3DDevice8Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface, UINT *PaletteNumber);
462 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount);
463 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT minIndex, UINT NumVertices, UINT startIndex, UINT primCount);
464 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride);
465 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);
466 extern HRESULT WINAPI IDirect3DDevice8Impl_ProcessVertices(LPDIRECT3DDEVICE8 iface, UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags);
467 extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage);
468 extern HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
469 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD* pHandle);
470 extern HRESULT WINAPI IDirect3DDevice8Impl_DeleteVertexShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
471 extern HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,CONST void* pConstantData,DWORD ConstantCount);
472 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,void* pConstantData,DWORD ConstantCount);
473 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderDeclaration(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
474 extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
475 extern HRESULT WINAPI IDirect3DDevice8Impl_SetStreamSource(LPDIRECT3DDEVICE8 iface, UINT StreamNumber,IDirect3DVertexBuffer8* pStreamData,UINT Stride);
476 extern HRESULT WINAPI IDirect3DDevice8Impl_GetStreamSource(LPDIRECT3DDEVICE8 iface, UINT StreamNumber,IDirect3DVertexBuffer8** ppStreamData,UINT* pStride);
477 extern HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex);
478 extern HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex);
479 extern HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pFunction,DWORD* pHandle);
480 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
481 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD* pHandle);
482 extern HRESULT WINAPI IDirect3DDevice8Impl_DeletePixelShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
483 extern HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,CONST void* pConstantData,DWORD ConstantCount);
484 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,void* pConstantData,DWORD ConstantCount);
485 extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
486 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawRectPatch(LPDIRECT3DDEVICE8 iface, UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo);
487 extern HRESULT WINAPI IDirect3DDevice8Impl_DrawTriPatch(LPDIRECT3DDEVICE8 iface, UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo);
488 extern HRESULT WINAPI IDirect3DDevice8Impl_DeletePatch(LPDIRECT3DDEVICE8 iface, UINT Handle);
490 /* internal Interfaces */
491 extern HRESULT WINAPI IDirect3DDevice8Impl_CleanRender(LPDIRECT3DDEVICE8 iface);
492 extern HRESULT WINAPI IDirect3DDevice8Impl_ActiveRender(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* RenderSurface, IDirect3DSurface8* StencilSurface);
495 /* ---------------- */
496 /* IDirect3DVolume8 */
497 /* ---------------- */
499 /*****************************************************************************
500 * Predeclare the interface implementation structures
502 extern ICOM_VTABLE(IDirect3DVolume8) Direct3DVolume8_Vtbl;
504 /*****************************************************************************
505 * IDirect3DVolume8 implementation structure
507 struct IDirect3DVolume8Impl
509 /* IUnknown fields */
510 ICOM_VFIELD(IDirect3DVolume8);
513 /* IDirect3DVolume8 fields */
514 IDirect3DDevice8Impl *Device;
515 D3DRESOURCETYPE ResourceType;
518 D3DVOLUME_DESC myDesc;
519 BYTE *allocatedMemory;
531 extern HRESULT WINAPI IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 iface,REFIID refiid,LPVOID *obj);
532 extern ULONG WINAPI IDirect3DVolume8Impl_AddRef(LPDIRECT3DVOLUME8 iface);
533 extern ULONG WINAPI IDirect3DVolume8Impl_Release(LPDIRECT3DVOLUME8 iface);
535 /* IDirect3DVolume8: */
536 extern HRESULT WINAPI IDirect3DVolume8Impl_GetDevice(LPDIRECT3DVOLUME8 iface, IDirect3DDevice8** ppDevice);
537 extern HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
538 extern HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
539 extern HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid);
540 extern HRESULT WINAPI IDirect3DVolume8Impl_GetContainer(LPDIRECT3DVOLUME8 iface, REFIID riid, void** ppContainer);
541 extern HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface, D3DVOLUME_DESC* pDesc);
542 extern HRESULT WINAPI IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
543 extern HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface);
545 /* internal Interfaces */
546 extern HRESULT WINAPI IDirect3DVolume8Impl_CleanDirtyBox(LPDIRECT3DVOLUME8 iface);
547 extern HRESULT WINAPI IDirect3DVolume8Impl_AddDirtyBox(LPDIRECT3DVOLUME8 iface, CONST D3DBOX* pDirtyBox);
549 /* ------------------- */
550 /* IDirect3DSwapChain8 */
551 /* ------------------- */
553 /*****************************************************************************
554 * Predeclare the interface implementation structures
556 extern ICOM_VTABLE(IDirect3DSwapChain8) Direct3DSwapChain8_Vtbl;
558 /*****************************************************************************
559 * IDirect3DSwapChain8 implementation structure
561 struct IDirect3DSwapChain8Impl
563 /* IUnknown fields */
564 ICOM_VFIELD(IDirect3DSwapChain8);
567 /* IDirect3DSwapChain8 fields */
568 IDirect3DSurface8Impl *frontBuffer;
569 IDirect3DSurface8Impl *backBuffer;
570 IDirect3DSurface8Impl *depthStencilBuffer;
571 D3DPRESENT_PARAMETERS PresentParms;
573 /* OpenGL/GLX related */
575 Drawable swap_drawable;
579 extern HRESULT WINAPI IDirect3DSwapChain8Impl_QueryInterface(LPDIRECT3DSWAPCHAIN8 iface, REFIID refiid, LPVOID *obj);
580 extern ULONG WINAPI IDirect3DSwapChain8Impl_AddRef(LPDIRECT3DSWAPCHAIN8 iface);
581 extern ULONG WINAPI IDirect3DSwapChain8Impl_Release(LPDIRECT3DSWAPCHAIN8 iface);
583 /* IDirect3DSwapChain8: */
584 extern HRESULT WINAPI IDirect3DSwapChain8Impl_Present(LPDIRECT3DSWAPCHAIN8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion);
585 extern HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer);
588 /* ----------------- */
589 /* IDirect3DSurface8 */
590 /* ----------------- */
592 /*****************************************************************************
593 * Predeclare the interface implementation structures
595 extern ICOM_VTABLE(IDirect3DSurface8) Direct3DSurface8_Vtbl;
597 /*****************************************************************************
598 * IDirect3DSurface8 implementation structure
600 struct IDirect3DSurface8Impl
602 /* IUnknown fields */
603 ICOM_VFIELD(IDirect3DSurface8);
606 /* IDirect3DSurface8 fields */
607 IDirect3DDevice8Impl *Device;
608 D3DRESOURCETYPE ResourceType;
611 D3DSURFACE_DESC myDesc;
612 BYTE *allocatedMemory;
624 extern HRESULT WINAPI IDirect3DSurface8Impl_QueryInterface(LPDIRECT3DSURFACE8 iface,REFIID refiid,LPVOID *obj);
625 extern ULONG WINAPI IDirect3DSurface8Impl_AddRef(LPDIRECT3DSURFACE8 iface);
626 extern ULONG WINAPI IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface);
628 /* IDirect3DSurface8: */
629 extern HRESULT WINAPI IDirect3DSurface8Impl_GetDevice(LPDIRECT3DSURFACE8 iface, IDirect3DDevice8** ppDevice);
630 extern HRESULT WINAPI IDirect3DSurface8Impl_SetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags);
631 extern HRESULT WINAPI IDirect3DSurface8Impl_GetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,void* pData,DWORD* pSizeOfData);
632 extern HRESULT WINAPI IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid);
633 extern HRESULT WINAPI IDirect3DSurface8Impl_GetContainer(LPDIRECT3DSURFACE8 iface, REFIID riid,void** ppContainer);
634 extern HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(LPDIRECT3DSURFACE8 iface, D3DSURFACE_DESC *pDesc);
635 extern HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect,DWORD Flags);
636 extern HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface);
638 /* internal Interfaces */
639 extern HRESULT WINAPI IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface, GLenum gl_target, GLenum gl_level);
640 extern HRESULT WINAPI IDirect3DSurface8Impl_SaveSnapshot(LPDIRECT3DSURFACE8 iface, const char* filename);
641 extern HRESULT WINAPI IDirect3DSurface8Impl_CleanDirtyRect(LPDIRECT3DSURFACE8 iface);
642 extern HRESULT WINAPI IDirect3DSurface8Impl_AddDirtyRect(LPDIRECT3DSURFACE8 iface, CONST RECT* pDirtyRect);
644 /* ------------------ */
645 /* IDirect3DResource8 */
646 /* ------------------ */
648 /*****************************************************************************
649 * Predeclare the interface implementation structures
651 extern ICOM_VTABLE(IDirect3DResource8) Direct3DResource8_Vtbl;
653 /*****************************************************************************
654 * IDirect3DResource8 implementation structure
656 struct IDirect3DResource8Impl
658 /* IUnknown fields */
659 ICOM_VFIELD(IDirect3DResource8);
662 /* IDirect3DResource8 fields */
663 IDirect3DDevice8Impl *Device;
664 D3DRESOURCETYPE ResourceType;
668 extern HRESULT WINAPI IDirect3DResource8Impl_QueryInterface(LPDIRECT3DRESOURCE8 iface,REFIID refiid,LPVOID *obj);
669 extern ULONG WINAPI IDirect3DResource8Impl_AddRef(LPDIRECT3DRESOURCE8 iface);
670 extern ULONG WINAPI IDirect3DResource8Impl_Release(LPDIRECT3DRESOURCE8 iface);
672 /* IDirect3DResource8: */
673 extern HRESULT WINAPI IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface, IDirect3DDevice8** ppDevice);
674 extern HRESULT WINAPI IDirect3DResource8Impl_SetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
675 extern HRESULT WINAPI IDirect3DResource8Impl_GetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
676 extern HRESULT WINAPI IDirect3DResource8Impl_FreePrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid);
677 extern DWORD WINAPI IDirect3DResource8Impl_SetPriority(LPDIRECT3DRESOURCE8 iface, DWORD PriorityNew);
678 extern DWORD WINAPI IDirect3DResource8Impl_GetPriority(LPDIRECT3DRESOURCE8 iface);
679 extern void WINAPI IDirect3DResource8Impl_PreLoad(LPDIRECT3DRESOURCE8 iface);
680 extern D3DRESOURCETYPE WINAPI IDirect3DResource8Impl_GetType(LPDIRECT3DRESOURCE8 iface);
682 /* internal Interfaces */
683 extern D3DPOOL WINAPI IDirect3DResource8Impl_GetPool(LPDIRECT3DRESOURCE8 iface);
686 /* ---------------------- */
687 /* IDirect3DVertexBuffer8 */
688 /* ---------------------- */
690 /*****************************************************************************
691 * Predeclare the interface implementation structures
693 extern ICOM_VTABLE(IDirect3DVertexBuffer8) Direct3DVertexBuffer8_Vtbl;
695 /*****************************************************************************
696 * IDirect3DVertexBuffer8 implementation structure
698 struct IDirect3DVertexBuffer8Impl
700 /* IUnknown fields */
701 ICOM_VFIELD(IDirect3DVertexBuffer8);
704 /* IDirect3DResource8 fields */
705 IDirect3DDevice8Impl *Device;
706 D3DRESOURCETYPE ResourceType;
708 /* IDirect3DVertexBuffer8 fields */
709 BYTE *allocatedMemory;
710 D3DVERTEXBUFFER_DESC currentDesc;
714 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_QueryInterface(LPDIRECT3DVERTEXBUFFER8 iface,REFIID refiid,LPVOID *obj);
715 extern ULONG WINAPI IDirect3DVertexBuffer8Impl_AddRef(LPDIRECT3DVERTEXBUFFER8 iface);
716 extern ULONG WINAPI IDirect3DVertexBuffer8Impl_Release(LPDIRECT3DVERTEXBUFFER8 iface);
718 /* IDirect3DVertexBuffer8: (Inherited from IDirect3DResource8) */
719 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDevice(LPDIRECT3DVERTEXBUFFER8 iface, IDirect3DDevice8** ppDevice);
720 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
721 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
722 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_FreePrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid);
723 extern DWORD WINAPI IDirect3DVertexBuffer8Impl_SetPriority(LPDIRECT3DVERTEXBUFFER8 iface, DWORD PriorityNew);
724 extern DWORD WINAPI IDirect3DVertexBuffer8Impl_GetPriority(LPDIRECT3DVERTEXBUFFER8 iface);
725 extern void WINAPI IDirect3DVertexBuffer8Impl_PreLoad(LPDIRECT3DVERTEXBUFFER8 iface);
726 extern D3DRESOURCETYPE WINAPI IDirect3DVertexBuffer8Impl_GetType(LPDIRECT3DVERTEXBUFFER8 iface);
728 /* IDirect3DVertexBuffer8: */
729 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_Lock(LPDIRECT3DVERTEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
730 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_Unlock(LPDIRECT3DVERTEXBUFFER8 iface);
731 extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8 iface, D3DVERTEXBUFFER_DESC *pDesc);
734 /* --------------------- */
735 /* IDirect3DIndexBuffer8 */
736 /* --------------------- */
738 /*****************************************************************************
739 * Predeclare the interface implementation structures
741 extern ICOM_VTABLE(IDirect3DIndexBuffer8) Direct3DIndexBuffer8_Vtbl;
743 /*****************************************************************************
744 * IDirect3DIndexBuffer8 implementation structure
746 struct IDirect3DIndexBuffer8Impl
748 /* IUnknown fields */
749 ICOM_VFIELD(IDirect3DIndexBuffer8);
752 /* IDirect3DResource8 fields */
753 IDirect3DDevice8Impl *Device;
754 D3DRESOURCETYPE ResourceType;
756 /* IDirect3DIndexBuffer8 fields */
757 void *allocatedMemory;
758 D3DINDEXBUFFER_DESC currentDesc;
762 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_QueryInterface(LPDIRECT3DINDEXBUFFER8 iface,REFIID refiid,LPVOID *obj);
763 extern ULONG WINAPI IDirect3DIndexBuffer8Impl_AddRef(LPDIRECT3DINDEXBUFFER8 iface);
764 extern ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 iface);
766 /* IDirect3DIndexBuffer8: (Inherited from IDirect3DResource8) */
767 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDevice(LPDIRECT3DINDEXBUFFER8 iface, IDirect3DDevice8** ppDevice);
768 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
769 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
770 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid);
771 extern DWORD WINAPI IDirect3DIndexBuffer8Impl_SetPriority(LPDIRECT3DINDEXBUFFER8 iface, DWORD PriorityNew);
772 extern DWORD WINAPI IDirect3DIndexBuffer8Impl_GetPriority(LPDIRECT3DINDEXBUFFER8 iface);
773 extern void WINAPI IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 iface);
774 extern D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer8Impl_GetType(LPDIRECT3DINDEXBUFFER8 iface);
776 /* IDirect3DIndexBuffer8: */
777 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
778 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 iface);
779 extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 iface, D3DINDEXBUFFER_DESC *pDesc);
782 /* --------------------- */
783 /* IDirect3DBaseTexture8 */
784 /* --------------------- */
786 /*****************************************************************************
787 * Predeclare the interface implementation structures
789 extern ICOM_VTABLE(IDirect3DBaseTexture8) Direct3DBaseTexture8_Vtbl;
791 /*****************************************************************************
792 * IDirect3DBaseTexture8 implementation structure
794 struct IDirect3DBaseTexture8Impl
796 /* IUnknown fields */
797 ICOM_VFIELD(IDirect3DBaseTexture8);
800 /* IDirect3DResource8 fields */
801 IDirect3DDevice8Impl *Device;
802 D3DRESOURCETYPE ResourceType;
804 /* IDirect3DBaseTexture8 fields */
815 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_QueryInterface(LPDIRECT3DBASETEXTURE8 iface,REFIID refiid,LPVOID *obj);
816 extern ULONG WINAPI IDirect3DBaseTexture8Impl_AddRef(LPDIRECT3DBASETEXTURE8 iface);
817 extern ULONG WINAPI IDirect3DBaseTexture8Impl_Release(LPDIRECT3DBASETEXTURE8 iface);
819 /* IDirect3DBaseTexture8: (Inherited from IDirect3DResource8) */
820 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_GetDevice(LPDIRECT3DBASETEXTURE8 iface, IDirect3DDevice8** ppDevice);
821 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_SetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
822 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_GetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
823 extern HRESULT WINAPI IDirect3DBaseTexture8Impl_FreePrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid);
824 extern DWORD WINAPI IDirect3DBaseTexture8Impl_SetPriority(LPDIRECT3DBASETEXTURE8 iface, DWORD PriorityNew);
825 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetPriority(LPDIRECT3DBASETEXTURE8 iface);
826 extern void WINAPI IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8 iface);
827 extern D3DRESOURCETYPE WINAPI IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8 iface);
829 /* IDirect3DBaseTexture8: */
830 extern DWORD WINAPI IDirect3DBaseTexture8Impl_SetLOD(LPDIRECT3DBASETEXTURE8 iface, DWORD LODNew);
831 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetLOD(LPDIRECT3DBASETEXTURE8 iface);
832 extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetLevelCount(LPDIRECT3DBASETEXTURE8 iface);
834 /* internal Interfaces */
835 extern BOOL WINAPI IDirect3DBaseTexture8Impl_IsDirty(LPDIRECT3DBASETEXTURE8 iface);
836 extern BOOL WINAPI IDirect3DBaseTexture8Impl_SetDirty(LPDIRECT3DBASETEXTURE8 iface, BOOL dirty);
839 /* --------------------- */
840 /* IDirect3DCubeTexture8 */
841 /* --------------------- */
843 /*****************************************************************************
844 * Predeclare the interface implementation structures
846 extern ICOM_VTABLE(IDirect3DCubeTexture8) Direct3DCubeTexture8_Vtbl;
848 /*****************************************************************************
849 * IDirect3DCubeTexture8 implementation structure
851 struct IDirect3DCubeTexture8Impl
853 /* IUnknown fields */
854 ICOM_VFIELD(IDirect3DCubeTexture8);
857 /* IDirect3DResource8 fields */
858 IDirect3DDevice8Impl *Device;
859 D3DRESOURCETYPE ResourceType;
861 /* IDirect3DBaseTexture8 fields */
866 /* IDirect3DCubeTexture8 fields */
870 IDirect3DSurface8Impl *surfaces[6][MAX_LEVELS];
874 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_QueryInterface(LPDIRECT3DCUBETEXTURE8 iface,REFIID refiid,LPVOID *obj);
875 extern ULONG WINAPI IDirect3DCubeTexture8Impl_AddRef(LPDIRECT3DCUBETEXTURE8 iface);
876 extern ULONG WINAPI IDirect3DCubeTexture8Impl_Release(LPDIRECT3DCUBETEXTURE8 iface);
878 /* IDirect3DCubeTexture8: (Inherited from IDirect3DResource8) */
879 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetDevice(LPDIRECT3DCUBETEXTURE8 iface, IDirect3DDevice8** ppDevice);
880 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
881 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
882 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_FreePrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid);
883 extern DWORD WINAPI IDirect3DCubeTexture8Impl_SetPriority(LPDIRECT3DCUBETEXTURE8 iface, DWORD PriorityNew);
884 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetPriority(LPDIRECT3DCUBETEXTURE8 iface);
885 extern void WINAPI IDirect3DCubeTexture8Impl_PreLoad(LPDIRECT3DCUBETEXTURE8 iface);
886 extern D3DRESOURCETYPE WINAPI IDirect3DCubeTexture8Impl_GetType(LPDIRECT3DCUBETEXTURE8 iface);
888 /* IDirect3DCubeTexture8: (Inherited from IDirect3DBaseTexture8) */
889 extern DWORD WINAPI IDirect3DCubeTexture8Impl_SetLOD(LPDIRECT3DCUBETEXTURE8 iface, DWORD LODNew);
890 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetLOD(LPDIRECT3DCUBETEXTURE8 iface);
891 extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE8 iface);
893 /* IDirect3DCubeTexture8 */
894 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE8 iface, UINT Level, D3DSURFACE_DESC* pDesc);
895 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface8** ppCubeMapSurface);
896 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
897 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, UINT Level);
898 extern HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXTURE8 iface, D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect);
901 /* ----------------- */
902 /* IDirect3DTexture8 */
903 /* ----------------- */
905 /*****************************************************************************
906 * Predeclare the interface implementation structures
908 extern ICOM_VTABLE(IDirect3DTexture8) Direct3DTexture8_Vtbl;
910 /*****************************************************************************
911 * IDirect3DTexture8 implementation structure
913 struct IDirect3DTexture8Impl
915 /* IUnknown fields */
916 ICOM_VFIELD(IDirect3DTexture8);
919 /* IDirect3DResourc8 fields */
920 IDirect3DDevice8Impl *Device;
921 D3DRESOURCETYPE ResourceType;
923 /* IDirect3DBaseTexture8 fields */
928 /* IDirect3DTexture8 fields */
933 IDirect3DSurface8Impl *surfaces[MAX_LEVELS];
937 extern HRESULT WINAPI IDirect3DTexture8Impl_QueryInterface(LPDIRECT3DTEXTURE8 iface,REFIID refiid,LPVOID *obj);
938 extern ULONG WINAPI IDirect3DTexture8Impl_AddRef(LPDIRECT3DTEXTURE8 iface);
939 extern ULONG WINAPI IDirect3DTexture8Impl_Release(LPDIRECT3DTEXTURE8 iface);
941 /* IDirect3DTexture8: (Inherited from IDirect3DResource8) */
942 extern HRESULT WINAPI IDirect3DTexture8Impl_GetDevice(LPDIRECT3DTEXTURE8 iface, IDirect3DDevice8** ppDevice);
943 extern HRESULT WINAPI IDirect3DTexture8Impl_SetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
944 extern HRESULT WINAPI IDirect3DTexture8Impl_GetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
945 extern HRESULT WINAPI IDirect3DTexture8Impl_FreePrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid);
946 extern DWORD WINAPI IDirect3DTexture8Impl_SetPriority(LPDIRECT3DTEXTURE8 iface, DWORD PriorityNew);
947 extern DWORD WINAPI IDirect3DTexture8Impl_GetPriority(LPDIRECT3DTEXTURE8 iface);
948 extern void WINAPI IDirect3DTexture8Impl_PreLoad(LPDIRECT3DTEXTURE8 iface);
949 extern D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(LPDIRECT3DTEXTURE8 iface);
951 /* IDirect3DTexture8: (Inherited from IDirect3DBaseTexture8) */
952 extern DWORD WINAPI IDirect3DTexture8Impl_SetLOD(LPDIRECT3DTEXTURE8 iface, DWORD LODNew);
953 extern DWORD WINAPI IDirect3DTexture8Impl_GetLOD(LPDIRECT3DTEXTURE8 iface);
954 extern DWORD WINAPI IDirect3DTexture8Impl_GetLevelCount(LPDIRECT3DTEXTURE8 iface);
956 /* IDirect3DTexture8: */
957 extern HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(LPDIRECT3DTEXTURE8 iface, UINT Level, D3DSURFACE_DESC* pDesc);
958 extern HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE8 iface, UINT Level, IDirect3DSurface8** ppSurfaceLevel);
959 extern HRESULT WINAPI IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags);
960 extern HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(LPDIRECT3DTEXTURE8 iface, UINT Level);
961 extern HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(LPDIRECT3DTEXTURE8 iface, CONST RECT* pDirtyRect);
964 /* ----------------------- */
965 /* IDirect3DVolumeTexture8 */
966 /* ----------------------- */
968 /*****************************************************************************
969 * Predeclare the interface implementation structures
971 extern ICOM_VTABLE(IDirect3DVolumeTexture8) Direct3DVolumeTexture8_Vtbl;
973 /*****************************************************************************
974 * IDirect3DVolumeTexture8 implementation structure
976 struct IDirect3DVolumeTexture8Impl
978 /* IUnknown fields */
979 ICOM_VFIELD(IDirect3DVolumeTexture8);
982 /* IDirect3DResource8 fields */
983 IDirect3DDevice8Impl *Device;
984 D3DRESOURCETYPE ResourceType;
986 /* IDirect3DBaseTexture8 fields */
991 /* IDirect3DVolumeTexture8 fields */
997 IDirect3DVolume8Impl *volumes[MAX_LEVELS];
1001 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE8 iface,REFIID refiid,LPVOID *obj);
1002 extern ULONG WINAPI IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8 iface);
1003 extern ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8 iface);
1005 /* IDirect3DVolumeTexture8: (Inherited from IDirect3DResource8) */
1006 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE8 iface, IDirect3DDevice8** ppDevice);
1007 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
1008 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
1009 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid);
1010 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD PriorityNew);
1011 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE8 iface);
1012 extern void WINAPI IDirect3DVolumeTexture8Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE8 iface);
1013 extern D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture8Impl_GetType(LPDIRECT3DVOLUMETEXTURE8 iface);
1015 /* IDirect3DVolumeTexture8: (Inherited from IDirect3DBaseTexture8) */
1016 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD LODNew);
1017 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE8 iface);
1018 extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE8 iface);
1020 /* IDirect3DVolumeTexture8: */
1021 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DVOLUME_DESC *pDesc);
1022 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, IDirect3DVolume8** ppVolumeLevel);
1023 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags);
1024 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level);
1025 extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE8 iface, CONST D3DBOX* pDirtyBox);
1028 /* ==============================================================================
1029 Private interfactes: beginning of cleaning/splitting for HAL and d3d9 support
1030 ============================================================================== */
1032 /* State Block for Begin/End/Capture/Create/Apply State Block */
1033 /* Note: Very long winded but I do not believe gl Lists will */
1034 /* resolve everything we need, so doing it manually for now */
1035 typedef struct SAVEDSTATES {
1038 BOOL stream_source[MAX_STREAMS];
1040 BOOL transform[HIGHEST_TRANSFORMSTATE];
1043 BOOL vertexShaderConstant;
1044 BOOL vertexShaderDecl;
1046 BOOL pixelShaderConstant;
1047 BOOL renderstate[HIGHEST_RENDER_STATE];
1048 BOOL texture_state[8][HIGHEST_TEXTURE_STATE];
1049 BOOL clipplane[MAX_CLIPPLANES];
1053 /* ----------------------- */
1054 /* IDirect3DStateBlockImpl */
1055 /* ----------------------- */
1057 /*****************************************************************************
1058 * Predeclare the interface implementation structures
1060 /*extern ICOM_VTABLE(IDirect3DStateBlock9) Direct3DStateBlock9_Vtbl;*/
1062 /*****************************************************************************
1063 * IDirect3DStateBlock implementation structure
1065 struct IDirect3DStateBlockImpl {
1066 /* IUnknown fields */
1067 /*ICOM_VFIELD(IDirect3DStateBlock9);*/
1070 /* The device, to be replaced by a IDirect3DDeviceImpl */
1071 IDirect3DDevice8Impl* device;
1073 D3DSTATEBLOCKTYPE blockType;
1075 SAVEDSTATES Changed;
1079 double clipplane[MAX_CLIPPLANES][4];
1082 UINT stream_stride[MAX_STREAMS];
1083 IDirect3DVertexBuffer8 *stream_source[MAX_STREAMS];
1087 IDirect3DIndexBuffer8* pIndexData;
1088 UINT baseVertexIndex;
1091 IDirect3DBaseTexture8 *textures[8];
1092 int textureDimensions[8];
1093 /* Texture State Stage */
1094 DWORD texture_state[8][HIGHEST_TEXTURE_STATE];
1097 PLIGHTINFOEL *lights; /* NOTE: active GL lights must be front of the chain */
1100 D3DMATERIAL8 material;
1103 DWORD renderstate[HIGHEST_RENDER_STATE];
1106 D3DMATRIX transforms[HIGHEST_TRANSFORMSTATE];
1109 D3DVIEWPORT8 viewport;
1114 /* Vertex Shader Declaration */
1115 IDirect3DVertexShaderDeclarationImpl* vertexShaderDecl;
1120 /* Indexed Vertex Blending */
1121 D3DVERTEXBLENDFLAGS vertex_blend;
1124 /* Vertex Shader Constant */
1125 D3DSHADERVECTOR vertexShaderConstant[D3D8_VSHADER_MAX_CONSTANTS];
1126 /* Pixel Shader Constant */
1127 D3DSHADERVECTOR pixelShaderConstant[D3D8_PSHADER_MAX_CONSTANTS];
1130 /* exported Interfaces */
1131 /* internal Interfaces */
1132 /* temporary internal Interfaces */
1133 extern HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* This);
1134 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateStateBlock(IDirect3DDevice8Impl* This, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlockImpl** ppStateBlock);
1135 extern HRESULT WINAPI IDirect3DDeviceImpl_DeleteStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl* pSB);
1136 extern HRESULT WINAPI IDirect3DDeviceImpl_BeginStateBlock(IDirect3DDevice8Impl* This);
1137 extern HRESULT WINAPI IDirect3DDeviceImpl_EndStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl** ppStateBlock);
1138 extern HRESULT WINAPI IDirect3DDeviceImpl_ApplyStateBlock(IDirect3DDevice8Impl* iface, IDirect3DStateBlockImpl* pSB);
1139 extern HRESULT WINAPI IDirect3DDeviceImpl_CaptureStateBlock(IDirect3DDevice8Impl* This, IDirect3DStateBlockImpl* pSB);
1141 /* ------------------------------------ */
1142 /* IDirect3DVertexShaderDeclarationImpl */
1143 /* ------------------------------------ */
1145 /*****************************************************************************
1146 * Predeclare the interface implementation structures
1148 /*extern ICOM_VTABLE(IDirect3DVertexShaderDeclaration9) Direct3DVertexShaderDeclaration9_Vtbl;*/
1150 /*****************************************************************************
1151 * IDirect3DVertexShaderDeclaration implementation structure
1153 struct IDirect3DVertexShaderDeclarationImpl {
1154 /* IUnknown fields */
1155 /*ICOM_VFIELD(IDirect3DVertexShaderDeclaration9);*/
1158 /* The device, to be replaced by a IDirect3DDeviceImpl */
1159 IDirect3DDevice8Impl* device;
1161 /** precomputed fvf if simple declaration */
1162 DWORD fvf[MAX_STREAMS];
1165 /** dx8 compatible Declaration fields */
1166 DWORD* pDeclaration8;
1167 DWORD declaration8Length;
1170 /* exported Interfaces */
1171 extern HRESULT WINAPI IDirect3DVertexShaderDeclarationImpl_GetDeclaration8(IDirect3DVertexShaderDeclarationImpl* This, DWORD* pData, UINT* pSizeOfData);
1172 /*extern HRESULT IDirect3DVertexShaderDeclarationImpl_GetDeclaration9(IDirect3DVertexShaderDeclarationImpl* This, D3DVERTEXELEMENT9* pData, UINT* pNumElements);*/
1173 /* internal Interfaces */
1174 /* temporary internal Interfaces */
1175 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateVertexShaderDeclaration8(IDirect3DDevice8Impl* This, CONST DWORD* pDeclaration8, IDirect3DVertexShaderDeclarationImpl** ppVertexShaderDecl);
1178 /* ------------------------- */
1179 /* IDirect3DVertexShaderImpl */
1180 /* ------------------------- */
1182 /*****************************************************************************
1183 * Predeclare the interface implementation structures
1185 /*extern ICOM_VTABLE(IDirect3DVertexShader9) Direct3DVertexShader9_Vtbl;*/
1187 /*****************************************************************************
1188 * IDirect3DVertexShader implementation structure
1190 struct IDirect3DVertexShaderImpl {
1191 /*ICOM_VFIELD(IDirect3DVertexShader9);*/
1194 /* The device, to be replaced by a IDirect3DDeviceImpl */
1195 IDirect3DDevice8Impl* device;
1198 UINT functionLength;
1199 DWORD usage; /* 0 || D3DUSAGE_SOFTWAREPROCESSING */
1201 /* run time datas */
1203 VSHADERINPUTDATA8 input;
1204 VSHADEROUTPUTDATA8 output;
1207 /* exported Interfaces */
1208 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetFunction(IDirect3DVertexShaderImpl* This, VOID* pData, UINT* pSizeOfData);
1209 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);*/
1210 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST INT* pConstantData, UINT Vector4iCount);*/
1211 extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount);
1212 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);*/
1213 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, INT* pConstantData, UINT Vector4iCount);*/
1214 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, FLOAT* pConstantData, UINT Vector4fCount);
1215 /* internal Interfaces */
1216 extern DWORD WINAPI IDirect3DVertexShaderImpl_GetVersion(IDirect3DVertexShaderImpl* This);
1217 extern HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* This, VSHADERINPUTDATA8* input, VSHADEROUTPUTDATA8* output);
1218 /* temporary internal Interfaces */
1219 extern HRESULT WINAPI IDirect3DDeviceImpl_CreateVertexShader(IDirect3DDevice8Impl* This, CONST DWORD* pFunction, DWORD Usage, IDirect3DVertexShaderImpl** ppVertexShader);
1220 extern HRESULT WINAPI IDirect3DDeviceImpl_FillVertexShaderInput(IDirect3DDevice8Impl* This, IDirect3DVertexShaderImpl* vshader, DWORD SkipnStrides);
1222 /* ------------------------ */
1223 /* IDirect3DPixelShaderImpl */
1224 /* ------------------------ */
1226 /*****************************************************************************
1227 * Predeclare the interface implementation structures
1229 /*extern ICOM_VTABLE(IDirect3DPixelShader9) Direct3DPixelShader9_Vtbl;*/
1231 /*****************************************************************************
1232 * IDirect3DPixelShader implementation structure
1234 struct IDirect3DPixelShaderImpl {
1235 /*ICOM_VFIELD(IDirect3DPixelShader9);*/
1238 /* The device, to be replaced by a IDirect3DDeviceImpl */
1239 IDirect3DDevice8Impl* device;
1242 UINT functionLength;
1244 /* run time datas */
1246 PSHADERINPUTDATA8 input;
1247 PSHADEROUTPUTDATA8 output;
1250 /* exported Interfaces */
1251 extern HRESULT WINAPI IDirect3DPixelShaderImpl_GetFunction(IDirect3DPixelShaderImpl* This, VOID* pData, UINT* pSizeOfData);
1252 /* internal Interfaces */
1253 extern DWORD WINAPI IDirect3DPixelShaderImpl_GetVersion(IDirect3DPixelShaderImpl* This);
1254 /* temporary internal Interfaces */
1255 extern HRESULT WINAPI IDirect3DDeviceImpl_CreatePixelShader(IDirect3DDevice8Impl* This, CONST DWORD* pFunction, IDirect3DPixelShaderImpl** ppPixelShader);
1259 * Internals functions
1261 * to see how not defined it here
1263 void GetSrcAndOpFromValue(DWORD iValue, BOOL isAlphaArg, GLenum* source, GLenum* operand);
1264 void setupTextureStates(LPDIRECT3DDEVICE8 iface, DWORD Stage, DWORD Flags);
1265 void set_tex_op(LPDIRECT3DDEVICE8 iface, BOOL isAlpha, int Stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3);
1267 SHORT D3DFmtGetBpp(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1268 GLint D3DFmt2GLIntFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1269 GLenum D3DFmt2GLFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1270 GLenum D3DFmt2GLType(IDirect3DDevice8Impl* This, D3DFORMAT fmt);
1272 GLenum D3DFmt2GLDepthFmt(D3DFORMAT fmt);
1273 GLenum D3DFmt2GLDepthType(D3DFORMAT fmt);
1275 int D3DPrimitiveListGetVertexSize(D3DPRIMITIVETYPE PrimitiveType, int iNumPrim);
1276 int D3DPrimitive2GLenum(D3DPRIMITIVETYPE PrimitiveType);
1277 int D3DFVFGetSize(D3DFORMAT fvf);
1279 int SOURCEx_RGB_EXT(DWORD arg);
1280 int OPERANDx_RGB_EXT(DWORD arg);
1281 int SOURCEx_ALPHA_EXT(DWORD arg);
1282 int OPERANDx_ALPHA_EXT(DWORD arg);
1283 GLenum StencilOp(DWORD op);
1286 * Internals debug functions
1288 const char* debug_d3ddevicetype(D3DDEVTYPE devtype);
1289 const char* debug_d3dusage(DWORD usage);
1290 const char* debug_d3dformat(D3DFORMAT fmt);
1291 const char* debug_d3dressourcetype(D3DRESOURCETYPE res);
1292 const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType);
1293 const char* debug_d3dpool(D3DPOOL Pool);
1294 const char *debug_d3drenderstate(DWORD State);
1295 const char *debug_d3dtexturestate(DWORD State);
1297 /* Some #defines for additional diagnostics */
1298 #if 0 /* NOTE: Must be 0 in cvs */
1299 /* To avoid having to get gigabytes of trace, the following can be compiled in, and at the start
1300 of each frame, a check is made for the existence of C:\D3DTRACE, and if if exists d3d trace
1301 is enabled, and if it doesnt exists it is disabled. */
1302 # define FRAME_DEBUGGING
1303 /* Adding in the SINGLE_FRAME_DEBUGGING gives a trace of just what makes up a single frame, before
1304 the file is deleted */
1305 # if 1 /* NOTE: Must be 1 in cvs, as this is mostly more useful than a trace from program start */
1306 # define SINGLE_FRAME_DEBUGGING
1308 /* The following, when enabled, lets you see the makeup of the frame, by drawprimitive calls.
1309 It can only be enabled when FRAME_DEBUGGING is also enabled
1310 The contents of the back buffer are written into /tmp/backbuffer_* after each primitive
1312 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
1313 # define SHOW_FRAME_MAKEUP 1
1315 /* The following, when enabled, lets you see the makeup of the all the textures used during each
1316 of the drawprimitive calls. It can only be enabled when SHOW_FRAME_MAKEUP is also enabled.
1317 The contents of the textures assigned to each stage are written into
1318 /tmp/texture_*_<Stage>.ppm after each primitive array is drawn. */
1319 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
1320 # define SHOW_TEXTURE_MAKEUP 0
1323 extern BOOL isDumpingFrames;
1324 extern LONG primCounter;
1327 /* Per-vertex trace: */
1328 #if 0 /* NOTE: Must be 0 in cvs */
1329 # define VTRACE(A) TRACE A
1334 #define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w);
1335 #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);
1337 #define DUMP_LIGHT_CHAIN() \
1339 PLIGHTINFOEL *el = This->StateBlock->lights;\
1341 TRACE("Light %p (glIndex %ld, d3dIndex %ld, enabled %d)\n", el, el->glIndex, el->OriginalIndex, el->lightEnabled);\
1346 #endif /* __WINE_D3DX8_PRIVATE_H */