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 :-/ */
32 #define GL_GLEXT_PROTOTYPES
34 #define GLX_GLXEXT_PROTOTYPES
36 #ifdef HAVE_GL_GLEXT_H
37 # include <GL/glext.h>
45 /* Redefines the constants */
46 #define CALLBACK __stdcall
47 #define WINAPI __stdcall
48 #define APIENTRY WINAPI
52 extern void (*wine_tsx11_lock_ptr
)(void);
53 extern void (*wine_tsx11_unlock_ptr
)(void);
55 /* As GLX relies on X, this is needed */
58 #define ENTER_GL() ++num_lock; TRACE("inc lock to: %d\n", num_lock); wine_tsx11_lock_ptr()
59 #define LEAVE_GL() if (num_lock > 2) TRACE("fucking locks: %d\n", num_lock); --num_lock; wine_tsx11_unlock_ptr()
61 #define ENTER_GL() wine_tsx11_lock_ptr()
62 #define LEAVE_GL() wine_tsx11_unlock_ptr()
70 #include "wine/wined3d_interface.h"
82 #define MAX_PALETTES 256
83 #define MAX_STREAMS 16
84 #define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
85 #define MAX_LEVELS 256
87 /* Other useful values */
88 #define HIGHEST_RENDER_STATE 174
89 #define HIGHEST_TEXTURE_STATE 29
90 #define HIGHEST_TRANSFORMSTATE 512
91 #define D3DSBT_RECORDED 0xfffffffe
93 /* Performance changes - Only reapply what is necessary */
94 #define REAPPLY_ALPHAOP 0x0001
95 #define REAPPLY_ALL 0xFFFF
97 /* CreateVertexShader can return > 0xFFFF */
98 #define VS_HIGHESTFIXEDFXF 0xF0000000
99 #define VERTEX_SHADER(Handle) \
100 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(VertexShaders) / sizeof(IDirect3DVertexShaderImpl*)) ? NULL : VertexShaders[Handle]) : VertexShaders[Handle - VS_HIGHESTFIXEDFXF])
101 #define VERTEX_SHADER_DECL(Handle) \
102 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(VertexShaderDeclarations) / sizeof(IDirect3DVertexShaderDeclarationImpl*)) ? NULL : VertexShaderDeclarations[Handle]) : VertexShaderDeclarations[Handle - VS_HIGHESTFIXEDFXF])
103 #define PIXEL_SHADER(Handle) \
104 ((Handle <= VS_HIGHESTFIXEDFXF) ? ((Handle >= sizeof(PixelShaders) / sizeof(IDirect3DPixelShaderImpl*)) ? NULL : PixelShaders[Handle]) : PixelShaders[Handle - VS_HIGHESTFIXEDFXF])
106 /* ===========================================================================
108 =========================================================================== */
109 /* Not nice, but it lets wined3d support different versions of directx */
110 #define D3D8CAPSTOWINECAPS(_pD3D8Caps, _pWineCaps) \
111 _pWineCaps->DeviceType = &_pD3D8Caps->DeviceType; \
112 _pWineCaps->AdapterOrdinal = &_pD3D8Caps->AdapterOrdinal; \
113 _pWineCaps->Caps = &_pD3D8Caps->Caps; \
114 _pWineCaps->Caps2 = &_pD3D8Caps->Caps2; \
115 _pWineCaps->Caps3 = &_pD3D8Caps->Caps3; \
116 _pWineCaps->PresentationIntervals = &_pD3D8Caps->PresentationIntervals; \
117 _pWineCaps->CursorCaps = &_pD3D8Caps->CursorCaps; \
118 _pWineCaps->DevCaps = &_pD3D8Caps->DevCaps; \
119 _pWineCaps->PrimitiveMiscCaps = &_pD3D8Caps->PrimitiveMiscCaps; \
120 _pWineCaps->RasterCaps = &_pD3D8Caps->RasterCaps; \
121 _pWineCaps->ZCmpCaps = &_pD3D8Caps->ZCmpCaps; \
122 _pWineCaps->SrcBlendCaps = &_pD3D8Caps->SrcBlendCaps; \
123 _pWineCaps->DestBlendCaps = &_pD3D8Caps->DestBlendCaps; \
124 _pWineCaps->AlphaCmpCaps = &_pD3D8Caps->AlphaCmpCaps; \
125 _pWineCaps->ShadeCaps = &_pD3D8Caps->ShadeCaps; \
126 _pWineCaps->TextureCaps = &_pD3D8Caps->TextureCaps; \
127 _pWineCaps->TextureFilterCaps = &_pD3D8Caps->TextureFilterCaps; \
128 _pWineCaps->CubeTextureFilterCaps = &_pD3D8Caps->CubeTextureFilterCaps; \
129 _pWineCaps->VolumeTextureFilterCaps = &_pD3D8Caps->VolumeTextureFilterCaps; \
130 _pWineCaps->TextureAddressCaps = &_pD3D8Caps->TextureAddressCaps; \
131 _pWineCaps->VolumeTextureAddressCaps = &_pD3D8Caps->VolumeTextureAddressCaps; \
132 _pWineCaps->LineCaps = &_pD3D8Caps->LineCaps; \
133 _pWineCaps->MaxTextureWidth = &_pD3D8Caps->MaxTextureWidth; \
134 _pWineCaps->MaxTextureHeight = &_pD3D8Caps->MaxTextureHeight; \
135 _pWineCaps->MaxVolumeExtent = &_pD3D8Caps->MaxVolumeExtent; \
136 _pWineCaps->MaxTextureRepeat = &_pD3D8Caps->MaxTextureRepeat; \
137 _pWineCaps->MaxTextureAspectRatio = &_pD3D8Caps->MaxTextureAspectRatio; \
138 _pWineCaps->MaxAnisotropy = &_pD3D8Caps->MaxAnisotropy; \
139 _pWineCaps->MaxVertexW = &_pD3D8Caps->MaxVertexW; \
140 _pWineCaps->GuardBandLeft = &_pD3D8Caps->GuardBandLeft; \
141 _pWineCaps->GuardBandTop = &_pD3D8Caps->GuardBandTop; \
142 _pWineCaps->GuardBandRight = &_pD3D8Caps->GuardBandRight; \
143 _pWineCaps->GuardBandBottom = &_pD3D8Caps->GuardBandBottom; \
144 _pWineCaps->ExtentsAdjust = &_pD3D8Caps->ExtentsAdjust; \
145 _pWineCaps->StencilCaps = &_pD3D8Caps->StencilCaps; \
146 _pWineCaps->FVFCaps = &_pD3D8Caps->FVFCaps; \
147 _pWineCaps->TextureOpCaps = &_pD3D8Caps->TextureOpCaps; \
148 _pWineCaps->MaxTextureBlendStages = &_pD3D8Caps->MaxTextureBlendStages; \
149 _pWineCaps->MaxSimultaneousTextures = &_pD3D8Caps->MaxSimultaneousTextures; \
150 _pWineCaps->VertexProcessingCaps = &_pD3D8Caps->VertexProcessingCaps; \
151 _pWineCaps->MaxActiveLights = &_pD3D8Caps->MaxActiveLights; \
152 _pWineCaps->MaxUserClipPlanes = &_pD3D8Caps->MaxUserClipPlanes; \
153 _pWineCaps->MaxVertexBlendMatrices = &_pD3D8Caps->MaxVertexBlendMatrices; \
154 _pWineCaps->MaxVertexBlendMatrixIndex = &_pD3D8Caps->MaxVertexBlendMatrixIndex; \
155 _pWineCaps->MaxPointSize = &_pD3D8Caps->MaxPointSize; \
156 _pWineCaps->MaxPrimitiveCount = &_pD3D8Caps->MaxPrimitiveCount; \
157 _pWineCaps->MaxVertexIndex = &_pD3D8Caps->MaxVertexIndex; \
158 _pWineCaps->MaxStreams = &_pD3D8Caps->MaxStreams; \
159 _pWineCaps->MaxStreamStride = &_pD3D8Caps->MaxStreamStride; \
160 _pWineCaps->VertexShaderVersion = &_pD3D8Caps->VertexShaderVersion; \
161 _pWineCaps->MaxVertexShaderConst = &_pD3D8Caps->MaxVertexShaderConst; \
162 _pWineCaps->PixelShaderVersion = &_pD3D8Caps->PixelShaderVersion; \
163 _pWineCaps->PixelShader1xMaxValue = &_pD3D8Caps->MaxPixelShaderValue;
165 /* Direct3D8 Interfaces: */
166 typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl
;
167 typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl
;
168 typedef struct IDirect3D8Impl IDirect3D8Impl
;
169 typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl
;
170 typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl
;
171 typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl
;
172 typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl
;
173 typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl
;
174 typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl
;
175 typedef struct IDirect3DResource8Impl IDirect3DResource8Impl
;
176 typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl
;
177 typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl
;
179 /** Private Interfaces: */
180 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl
;
181 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl
;
182 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl
;
183 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl
;
185 typedef struct D3DSHADERVECTOR
{
192 typedef struct D3DSHADERSCALAR
{
196 #define D3D8_VSHADER_MAX_CONSTANTS 96
197 typedef D3DSHADERVECTOR VSHADERCONSTANTS8
[D3D8_VSHADER_MAX_CONSTANTS
];
199 typedef struct VSHADERDATA8
{
200 /** Run Time Shader Function Constants */
201 /*D3DXBUFFER* constants;*/
203 /** Shader Code as char ... */
208 /** temporary here waiting for buffer code */
209 typedef struct VSHADERINPUTDATA8
{
210 D3DSHADERVECTOR V
[17];
213 /** temporary here waiting for buffer code */
214 typedef struct VSHADEROUTPUTDATA8
{
215 D3DSHADERVECTOR oPos
;
216 D3DSHADERVECTOR oD
[2];
217 D3DSHADERVECTOR oT
[8];
218 D3DSHADERVECTOR oFog
;
219 D3DSHADERVECTOR oPts
;
220 } VSHADEROUTPUTDATA8
;
223 #define D3D8_PSHADER_MAX_CONSTANTS 32
224 typedef D3DSHADERVECTOR PSHADERCONSTANTS8
[D3D8_PSHADER_MAX_CONSTANTS
];
226 typedef struct PSHADERDATA8
{
227 /** Run Time Shader Function Constants */
228 /*D3DXBUFFER* constants;*/
230 /** Shader Code as char ... */
235 /** temporary here waiting for buffer code */
236 typedef struct PSHADERINPUTDATA8
{
237 D3DSHADERVECTOR V
[2];
238 D3DSHADERVECTOR T
[8];
239 D3DSHADERVECTOR S
[16];
240 /*D3DSHADERVECTOR R[12];*/
243 /** temporary here waiting for buffer code */
244 typedef struct PSHADEROUTPUTDATA8
{
245 D3DSHADERVECTOR oC
[4];
246 D3DSHADERVECTOR oDepth
;
247 } PSHADEROUTPUTDATA8
;
250 * Private definitions for internal use only
252 typedef struct PLIGHTINFOEL PLIGHTINFOEL
;
253 struct PLIGHTINFOEL
{
254 D3DLIGHT8 OriginalParms
;
261 /* Converted parms to speed up swapping lights */
274 #define checkGLcall(A) \
276 GLint err = glGetError(); \
277 if (err != GL_NO_ERROR) { \
278 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
280 TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \
283 #define vcheckGLcall(A) \
285 GLint err = glGetError(); \
286 if (err != GL_NO_ERROR) { \
287 FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
289 VTRACE(("%s call ok %s / %d\n", A, __FILE__, __LINE__)); \
293 #include "d3dcore_gl.h"
296 #define GL_LIMITS(ExtName) (This->direct3d8->gl_info.max_##ExtName)
297 #define GL_SUPPORT(ExtName) (TRUE == This->direct3d8->gl_info.supported[ExtName])
298 #define GL_SUPPORT_DEV(ExtName, dev) (TRUE == (dev)->direct3d8->gl_info.supported[ExtName])
299 #define GL_EXTCALL(FuncName) (This->direct3d8->gl_info.FuncName)
300 #define GL_EXTCALL_DEV(FuncName, dev) ((dev)->direct3d8->gl_info.FuncName)
303 #define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f)
304 #define D3DCOLOR_G(dw) (((float) (((dw) >> 8) & 0xFF)) / 255.0f)
305 #define D3DCOLOR_B(dw) (((float) (((dw) >> 0) & 0xFF)) / 255.0f)
306 #define D3DCOLOR_A(dw) (((float) (((dw) >> 24) & 0xFF)) / 255.0f)
308 #define D3DCOLORTOCOLORVALUE(dw, col) \
309 (col).r = D3DCOLOR_R(dw); \
310 (col).g = D3DCOLOR_G(dw); \
311 (col).b = D3DCOLOR_B(dw); \
312 (col).a = D3DCOLOR_A(dw);
314 #define D3DCOLORTOVECTOR4(dw, vec) \
315 (vec).x = D3DCOLOR_R(dw); \
316 (vec).y = D3DCOLOR_G(dw); \
317 (vec).z = D3DCOLOR_B(dw); \
318 (vec).w = D3DCOLOR_A(dw);
320 #define D3DCOLORTOGLFLOAT4(dw, vec) \
321 (vec)[0] = D3DCOLOR_R(dw); \
322 (vec)[1] = D3DCOLOR_G(dw); \
323 (vec)[2] = D3DCOLOR_B(dw); \
324 (vec)[3] = D3DCOLOR_A(dw);
326 /* ===========================================================================
327 The interfactes themselves
328 =========================================================================== */
334 /*****************************************************************************
335 * Predeclare the interface implementation structures
337 extern const IDirect3D8Vtbl Direct3D8_Vtbl
;
339 /*****************************************************************************
340 * IDirect3D implementation structure
342 struct IDirect3D8Impl
344 /* IUnknown fields */
345 const IDirect3D8Vtbl
*lpVtbl
;
348 /* The WineD3D device */
351 /* IDirect3D8 fields */
354 IDirect3D8Impl
*direct3d8
;
358 extern HRESULT WINAPI
IDirect3D8Impl_QueryInterface(LPDIRECT3D8 iface
,REFIID refiid
,LPVOID
*obj
);
359 extern ULONG WINAPI
IDirect3D8Impl_AddRef(LPDIRECT3D8 iface
);
360 extern ULONG WINAPI
IDirect3D8Impl_Release(LPDIRECT3D8 iface
);
363 extern HRESULT WINAPI
IDirect3D8Impl_RegisterSoftwareDevice(LPDIRECT3D8 iface
, void* pInitializeFunction
);
364 extern UINT WINAPI
IDirect3D8Impl_GetAdapterCount(LPDIRECT3D8 iface
);
365 extern HRESULT WINAPI
IDirect3D8Impl_GetAdapterIdentifier(LPDIRECT3D8 iface
, UINT Adapter
, DWORD Flags
, D3DADAPTER_IDENTIFIER8
* pIdentifier
);
366 extern UINT WINAPI
IDirect3D8Impl_GetAdapterModeCount(LPDIRECT3D8 iface
, UINT Adapter
);
367 extern HRESULT WINAPI
IDirect3D8Impl_EnumAdapterModes(LPDIRECT3D8 iface
, UINT Adapter
, UINT Mode
, D3DDISPLAYMODE
* pMode
);
368 extern HRESULT WINAPI
IDirect3D8Impl_GetAdapterDisplayMode(LPDIRECT3D8 iface
, UINT Adapter
, D3DDISPLAYMODE
* pMode
);
369 extern HRESULT WINAPI
IDirect3D8Impl_CheckDeviceType(LPDIRECT3D8 iface
, UINT Adapter
, D3DDEVTYPE CheckType
, D3DFORMAT DisplayFormat
,
370 D3DFORMAT BackBufferFormat
, BOOL Windowed
);
371 extern HRESULT WINAPI
IDirect3D8Impl_CheckDeviceFormat(LPDIRECT3D8 iface
, UINT Adapter
, D3DDEVTYPE DeviceType
, D3DFORMAT AdapterFormat
,
372 DWORD Usage
, D3DRESOURCETYPE RType
, D3DFORMAT CheckFormat
);
373 extern HRESULT WINAPI
IDirect3D8Impl_CheckDeviceMultiSampleType(LPDIRECT3D8 iface
, UINT Adapter
, D3DDEVTYPE DeviceType
, D3DFORMAT SurfaceFormat
,
374 BOOL Windowed
, D3DMULTISAMPLE_TYPE MultiSampleType
);
375 extern HRESULT WINAPI
IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface
, UINT Adapter
, D3DDEVTYPE DeviceType
, D3DFORMAT AdapterFormat
,
376 D3DFORMAT RenderTargetFormat
, D3DFORMAT DepthStencilFormat
);
377 extern HRESULT WINAPI
IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface
, UINT Adapter
, D3DDEVTYPE DeviceType
, D3DCAPS8
* pCaps
);
378 extern HMONITOR WINAPI
IDirect3D8Impl_GetAdapterMonitor(LPDIRECT3D8 iface
, UINT Adapter
);
379 extern HRESULT WINAPI
IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface
, UINT Adapter
, D3DDEVTYPE DeviceType
, HWND hFocusWindow
,
380 DWORD BehaviorFlags
, D3DPRESENT_PARAMETERS
* pPresentationParameters
,
381 IDirect3DDevice8
** ppReturnedDeviceInterface
);
383 /* ---------------- */
384 /* IDirect3DDevice8 */
385 /* ---------------- */
387 /*****************************************************************************
388 * Predeclare the interface implementation structures
390 extern const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl
;
392 /*****************************************************************************
393 * IDirect3DDevice8 implementation structure
395 struct IDirect3DDevice8Impl
397 /* IUnknown fields */
398 const IDirect3DDevice8Vtbl
*lpVtbl
;
401 /* IDirect3DDevice8 fields */
402 IDirect3D8Impl
*direct3d8
;
403 IWineD3DDevice
*WineD3DDevice
;
405 IDirect3DSurface8Impl
*frontBuffer
;
406 IDirect3DSurface8Impl
*backBuffer
;
407 IDirect3DSurface8Impl
*depthStencilBuffer
;
409 IDirect3DSurface8Impl
*renderTarget
;
410 IDirect3DSurface8Impl
*stencilBufferTarget
;
412 D3DPRESENT_PARAMETERS PresentParms
;
413 D3DDEVICE_CREATION_PARAMETERS CreateParms
;
423 /* State block related */
424 BOOL isRecordingState
;
425 IDirect3DStateBlockImpl
*StateBlock
;
426 IDirect3DStateBlockImpl
*UpdateStateBlock
;
428 /* palettes texture management */
429 PALETTEENTRY palettes
[MAX_PALETTES
][256];
432 BOOL texture_shader_active
;
435 BOOL modelview_valid
;
437 BOOL view_ident
; /* true iff view matrix is identity */
438 BOOL last_was_rhw
; /* true iff last draw_primitive was in xyzrhw mode */
439 GLenum tracking_parm
; /* Which source is tracking current colour */
440 LONG tracking_color
; /* used iff GL_COLOR_MATERIAL was enabled */
441 #define DISABLED_TRACKING 0 /* Disabled */
442 #define IS_TRACKING 1 /* tracking_parm is tracking diffuse color */
443 #define NEEDS_TRACKING 2 /* Tracking needs to be enabled when needed */
444 #define NEEDS_DISABLE 3 /* Tracking needs to be disabled when needed*/
448 XVisualInfo
*visInfo
;
452 GLXContext render_ctx
;
454 GLint maxConcurrentLights
;
456 /* OpenGL Extension related */
458 /* Cursor management */
466 UINT dummyTextureName
[8];
468 /* For rendering to a texture using glCopyTexImage */
469 BOOL renderUpsideDown
;
473 extern HRESULT WINAPI
IDirect3DDevice8Impl_QueryInterface(LPDIRECT3DDEVICE8 iface
, REFIID refiid
, LPVOID
*obj
);
474 extern ULONG WINAPI
IDirect3DDevice8Impl_AddRef(LPDIRECT3DDEVICE8 iface
);
475 extern ULONG WINAPI
IDirect3DDevice8Impl_Release(LPDIRECT3DDEVICE8 iface
);
477 /* IDirect3DDevice8: */
478 extern HRESULT WINAPI
IDirect3DDevice8Impl_TestCooperativeLevel(LPDIRECT3DDEVICE8 iface
);
479 extern UINT WINAPI
IDirect3DDevice8Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE8 iface
);
480 extern HRESULT WINAPI
IDirect3DDevice8Impl_ResourceManagerDiscardBytes(LPDIRECT3DDEVICE8 iface
, DWORD Bytes
);
481 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetDirect3D(LPDIRECT3DDEVICE8 iface
, IDirect3D8
** ppD3D8
);
482 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetDeviceCaps(LPDIRECT3DDEVICE8 iface
, D3DCAPS8
* pCaps
);
483 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetDisplayMode(LPDIRECT3DDEVICE8 iface
, D3DDISPLAYMODE
* pMode
);
484 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetCreationParameters(LPDIRECT3DDEVICE8 iface
, D3DDEVICE_CREATION_PARAMETERS
* pParameters
);
485 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetCursorProperties(LPDIRECT3DDEVICE8 iface
, UINT XHotSpot
, UINT YHotSpot
, IDirect3DSurface8
* pCursorBitmap
);
486 extern void WINAPI
IDirect3DDevice8Impl_SetCursorPosition(LPDIRECT3DDEVICE8 iface
, UINT XScreenSpace
, UINT YScreenSpace
, DWORD Flags
);
487 extern BOOL WINAPI
IDirect3DDevice8Impl_ShowCursor(LPDIRECT3DDEVICE8 iface
, BOOL bShow
);
488 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE8 iface
, D3DPRESENT_PARAMETERS
* pPresentationParameters
, IDirect3DSwapChain8
** pSwapChain
);
489 extern HRESULT WINAPI
IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface
, D3DPRESENT_PARAMETERS
* pPresentationParameters
);
490 extern HRESULT WINAPI
IDirect3DDevice8Impl_Present(LPDIRECT3DDEVICE8 iface
, CONST RECT
* pSourceRect
, CONST RECT
* pDestRect
, HWND hDestWindowOverride
, CONST RGNDATA
* pDirtyRegion
);
491 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetBackBuffer(LPDIRECT3DDEVICE8 iface
, UINT BackBuffer
, D3DBACKBUFFER_TYPE Type
, IDirect3DSurface8
** ppBackBuffer
);
492 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetRasterStatus(LPDIRECT3DDEVICE8 iface
, D3DRASTER_STATUS
* pRasterStatus
);
493 extern void WINAPI
IDirect3DDevice8Impl_SetGammaRamp(LPDIRECT3DDEVICE8 iface
, DWORD Flags
, CONST D3DGAMMARAMP
* pRamp
);
494 extern void WINAPI
IDirect3DDevice8Impl_GetGammaRamp(LPDIRECT3DDEVICE8 iface
, D3DGAMMARAMP
* pRamp
);
495 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface
, UINT Width
, UINT Height
, UINT Levels
, DWORD Usage
, D3DFORMAT Format
, D3DPOOL Pool
, IDirect3DTexture8
** ppTexture
);
496 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface
, UINT Width
, UINT Height
, UINT Depth
, UINT Levels
, DWORD Usage
, D3DFORMAT Format
, D3DPOOL Pool
, IDirect3DVolumeTexture8
** ppVolumeTexture
);
497 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 iface
, UINT EdgeLength
, UINT Levels
, DWORD Usage
, D3DFORMAT Format
, D3DPOOL Pool
, IDirect3DCubeTexture8
** ppCubeTexture
);
498 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateVertexBuffer(LPDIRECT3DDEVICE8 iface
, UINT Length
, DWORD Usage
, DWORD FVF
, D3DPOOL Pool
, IDirect3DVertexBuffer8
** ppVertexBuffer
);
499 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateIndexBuffer(LPDIRECT3DDEVICE8 iface
, UINT Length
, DWORD Usage
, D3DFORMAT Format
, D3DPOOL Pool
, IDirect3DIndexBuffer8
** ppIndexBuffer
);
500 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateRenderTarget(LPDIRECT3DDEVICE8 iface
, UINT Width
, UINT Height
, D3DFORMAT Format
, D3DMULTISAMPLE_TYPE MultiSample
, BOOL Lockable
, IDirect3DSurface8
** ppSurface
);
501 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE8 iface
, UINT Width
, UINT Height
, D3DFORMAT Format
, D3DMULTISAMPLE_TYPE MultiSample
, IDirect3DSurface8
** ppSurface
);
502 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateImageSurface(LPDIRECT3DDEVICE8 iface
, UINT Width
, UINT Height
, D3DFORMAT Format
, IDirect3DSurface8
** ppSurface
);
503 extern HRESULT WINAPI
IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface
, IDirect3DSurface8
* pSourceSurface
, CONST RECT
* pSourceRectsArray
, UINT cRects
, IDirect3DSurface8
* pDestinationSurface
, CONST POINT
* pDestPointsArray
);
504 extern HRESULT WINAPI
IDirect3DDevice8Impl_UpdateTexture(LPDIRECT3DDEVICE8 iface
, IDirect3DBaseTexture8
* pSourceTexture
, IDirect3DBaseTexture8
* pDestinationTexture
);
505 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetFrontBuffer(LPDIRECT3DDEVICE8 iface
, IDirect3DSurface8
* pDestSurface
);
506 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetRenderTarget(LPDIRECT3DDEVICE8 iface
, IDirect3DSurface8
* pRenderTarget
, IDirect3DSurface8
* pNewZStencil
);
507 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetRenderTarget(LPDIRECT3DDEVICE8 iface
, IDirect3DSurface8
** ppRenderTarget
);
508 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE8 iface
, IDirect3DSurface8
** ppZStencilSurface
);
509 extern HRESULT WINAPI
IDirect3DDevice8Impl_BeginScene(LPDIRECT3DDEVICE8 iface
);
510 extern HRESULT WINAPI
IDirect3DDevice8Impl_EndScene(LPDIRECT3DDEVICE8 iface
);
511 extern HRESULT WINAPI
IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface
, DWORD Count
, CONST D3DRECT
* pRects
, DWORD Flags
, D3DCOLOR Color
, float Z
, DWORD Stencil
);
512 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface
, D3DTRANSFORMSTATETYPE State
, CONST D3DMATRIX
* pMatrix
);
513 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetTransform(LPDIRECT3DDEVICE8 iface
, D3DTRANSFORMSTATETYPE State
, D3DMATRIX
* pMatrix
);
514 extern HRESULT WINAPI
IDirect3DDevice8Impl_MultiplyTransform(LPDIRECT3DDEVICE8 iface
, D3DTRANSFORMSTATETYPE State
, CONST D3DMATRIX
* pMatrix
);
515 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetViewport(LPDIRECT3DDEVICE8 iface
, CONST D3DVIEWPORT8
* pViewport
);
516 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetViewport(LPDIRECT3DDEVICE8 iface
, D3DVIEWPORT8
* pViewport
);
517 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetMaterial(LPDIRECT3DDEVICE8 iface
, CONST D3DMATERIAL8
* pMaterial
);
518 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetMaterial(LPDIRECT3DDEVICE8 iface
, D3DMATERIAL8
* pMaterial
);
519 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetLight(LPDIRECT3DDEVICE8 iface
, DWORD Index
, CONST D3DLIGHT8
* pLight
);
520 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetLight(LPDIRECT3DDEVICE8 iface
, DWORD Index
, D3DLIGHT8
* pLight
);
521 extern HRESULT WINAPI
IDirect3DDevice8Impl_LightEnable(LPDIRECT3DDEVICE8 iface
, DWORD Index
, BOOL Enable
);
522 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetLightEnable(LPDIRECT3DDEVICE8 iface
, DWORD Index
, BOOL
* pEnable
);
523 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetClipPlane(LPDIRECT3DDEVICE8 iface
, DWORD Index
, CONST
float* pPlane
);
524 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetClipPlane(LPDIRECT3DDEVICE8 iface
, DWORD Index
, float* pPlane
);
525 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface
, D3DRENDERSTATETYPE State
, DWORD Value
);
526 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetRenderState(LPDIRECT3DDEVICE8 iface
, D3DRENDERSTATETYPE State
, DWORD
* pValue
);
527 extern HRESULT WINAPI
IDirect3DDevice8Impl_BeginStateBlock(LPDIRECT3DDEVICE8 iface
);
528 extern HRESULT WINAPI
IDirect3DDevice8Impl_EndStateBlock(LPDIRECT3DDEVICE8 iface
, DWORD
* pToken
);
529 extern HRESULT WINAPI
IDirect3DDevice8Impl_ApplyStateBlock(LPDIRECT3DDEVICE8 iface
, DWORD Token
);
530 extern HRESULT WINAPI
IDirect3DDevice8Impl_CaptureStateBlock(LPDIRECT3DDEVICE8 iface
, DWORD Token
);
531 extern HRESULT WINAPI
IDirect3DDevice8Impl_DeleteStateBlock(LPDIRECT3DDEVICE8 iface
, DWORD Token
);
532 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateStateBlock(LPDIRECT3DDEVICE8 iface
, D3DSTATEBLOCKTYPE Type
,DWORD
* pToken
);
533 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetClipStatus(LPDIRECT3DDEVICE8 iface
, CONST D3DCLIPSTATUS8
* pClipStatus
);
534 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetClipStatus(LPDIRECT3DDEVICE8 iface
, D3DCLIPSTATUS8
* pClipStatus
);
535 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetTexture(LPDIRECT3DDEVICE8 iface
, DWORD Stage
, IDirect3DBaseTexture8
** ppTexture
);
536 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetTexture(LPDIRECT3DDEVICE8 iface
, DWORD Stage
, IDirect3DBaseTexture8
* pTexture
);
537 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetTextureStageState(LPDIRECT3DDEVICE8 iface
, DWORD Stage
, D3DTEXTURESTAGESTATETYPE Type
, DWORD
* pValue
);
538 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 iface
, DWORD Stage
, D3DTEXTURESTAGESTATETYPE Type
, DWORD Value
);
539 extern HRESULT WINAPI
IDirect3DDevice8Impl_ValidateDevice(LPDIRECT3DDEVICE8 iface
, DWORD
* pNumPasses
);
540 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetInfo(LPDIRECT3DDEVICE8 iface
, DWORD DevInfoID
, void* pDevInfoStruct
, DWORD DevInfoStructSize
);
541 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetPaletteEntries(LPDIRECT3DDEVICE8 iface
, UINT PaletteNumber
, CONST PALETTEENTRY
* pEntries
);
542 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetPaletteEntries(LPDIRECT3DDEVICE8 iface
, UINT PaletteNumber
, PALETTEENTRY
* pEntries
);
543 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface
, UINT PaletteNumber
);
544 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface
, UINT
*PaletteNumber
);
545 extern HRESULT WINAPI
IDirect3DDevice8Impl_DrawPrimitive(LPDIRECT3DDEVICE8 iface
, D3DPRIMITIVETYPE PrimitiveType
, UINT StartVertex
, UINT PrimitiveCount
);
546 extern HRESULT WINAPI
IDirect3DDevice8Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE8 iface
, D3DPRIMITIVETYPE PrimitiveType
, UINT minIndex
, UINT NumVertices
, UINT startIndex
, UINT primCount
);
547 extern HRESULT WINAPI
IDirect3DDevice8Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE8 iface
, D3DPRIMITIVETYPE PrimitiveType
, UINT PrimitiveCount
, CONST
void* pVertexStreamZeroData
, UINT VertexStreamZeroStride
);
548 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
);
549 extern HRESULT WINAPI
IDirect3DDevice8Impl_ProcessVertices(LPDIRECT3DDEVICE8 iface
, UINT SrcStartIndex
,UINT DestIndex
,UINT VertexCount
,IDirect3DVertexBuffer8
* pDestBuffer
,DWORD Flags
);
550 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8 iface
, CONST DWORD
* pDeclaration
,CONST DWORD
* pFunction
,DWORD
* pHandle
,DWORD Usage
);
551 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetVertexShader(LPDIRECT3DDEVICE8 iface
, DWORD Handle
);
552 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetVertexShader(LPDIRECT3DDEVICE8 iface
, DWORD
* pHandle
);
553 extern HRESULT WINAPI
IDirect3DDevice8Impl_DeleteVertexShader(LPDIRECT3DDEVICE8 iface
, DWORD Handle
);
554 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetVertexShaderConstant(LPDIRECT3DDEVICE8 iface
, DWORD Register
,CONST
void* pConstantData
,DWORD ConstantCount
);
555 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetVertexShaderConstant(LPDIRECT3DDEVICE8 iface
, DWORD Register
,void* pConstantData
,DWORD ConstantCount
);
556 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetVertexShaderDeclaration(LPDIRECT3DDEVICE8 iface
, DWORD Handle
,void* pData
,DWORD
* pSizeOfData
);
557 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetVertexShaderFunction(LPDIRECT3DDEVICE8 iface
, DWORD Handle
,void* pData
,DWORD
* pSizeOfData
);
558 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetStreamSource(LPDIRECT3DDEVICE8 iface
, UINT StreamNumber
,IDirect3DVertexBuffer8
* pStreamData
,UINT Stride
);
559 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetStreamSource(LPDIRECT3DDEVICE8 iface
, UINT StreamNumber
,IDirect3DVertexBuffer8
** ppStreamData
,UINT
* pStride
);
560 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface
, IDirect3DIndexBuffer8
* pIndexData
,UINT BaseVertexIndex
);
561 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface
, IDirect3DIndexBuffer8
** ppIndexData
,UINT
* pBaseVertexIndex
);
562 extern HRESULT WINAPI
IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 iface
, CONST DWORD
* pFunction
,DWORD
* pHandle
);
563 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetPixelShader(LPDIRECT3DDEVICE8 iface
, DWORD Handle
);
564 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetPixelShader(LPDIRECT3DDEVICE8 iface
, DWORD
* pHandle
);
565 extern HRESULT WINAPI
IDirect3DDevice8Impl_DeletePixelShader(LPDIRECT3DDEVICE8 iface
, DWORD Handle
);
566 extern HRESULT WINAPI
IDirect3DDevice8Impl_SetPixelShaderConstant(LPDIRECT3DDEVICE8 iface
, DWORD Register
,CONST
void* pConstantData
,DWORD ConstantCount
);
567 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetPixelShaderConstant(LPDIRECT3DDEVICE8 iface
, DWORD Register
,void* pConstantData
,DWORD ConstantCount
);
568 extern HRESULT WINAPI
IDirect3DDevice8Impl_GetPixelShaderFunction(LPDIRECT3DDEVICE8 iface
, DWORD Handle
,void* pData
,DWORD
* pSizeOfData
);
569 extern HRESULT WINAPI
IDirect3DDevice8Impl_DrawRectPatch(LPDIRECT3DDEVICE8 iface
, UINT Handle
,CONST
float* pNumSegs
,CONST D3DRECTPATCH_INFO
* pRectPatchInfo
);
570 extern HRESULT WINAPI
IDirect3DDevice8Impl_DrawTriPatch(LPDIRECT3DDEVICE8 iface
, UINT Handle
,CONST
float* pNumSegs
,CONST D3DTRIPATCH_INFO
* pTriPatchInfo
);
571 extern HRESULT WINAPI
IDirect3DDevice8Impl_DeletePatch(LPDIRECT3DDEVICE8 iface
, UINT Handle
);
573 /* internal Interfaces */
574 extern HRESULT WINAPI
IDirect3DDevice8Impl_CleanRender(LPDIRECT3DDEVICE8 iface
);
575 extern HRESULT WINAPI
IDirect3DDevice8Impl_ActiveRender(LPDIRECT3DDEVICE8 iface
, IDirect3DSurface8
* RenderSurface
, IDirect3DSurface8
* StencilSurface
);
578 /* ---------------- */
579 /* IDirect3DVolume8 */
580 /* ---------------- */
582 /*****************************************************************************
583 * Predeclare the interface implementation structures
585 extern const IDirect3DVolume8Vtbl Direct3DVolume8_Vtbl
;
587 /*****************************************************************************
588 * IDirect3DVolume8 implementation structure
590 struct IDirect3DVolume8Impl
592 /* IUnknown fields */
593 const IDirect3DVolume8Vtbl
*lpVtbl
;
596 /* IDirect3DVolume8 fields */
597 IDirect3DDevice8Impl
*Device
;
598 D3DRESOURCETYPE ResourceType
;
601 D3DVOLUME_DESC myDesc
;
602 BYTE
*allocatedMemory
;
614 extern HRESULT WINAPI
IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 iface
,REFIID refiid
,LPVOID
*obj
);
615 extern ULONG WINAPI
IDirect3DVolume8Impl_AddRef(LPDIRECT3DVOLUME8 iface
);
616 extern ULONG WINAPI
IDirect3DVolume8Impl_Release(LPDIRECT3DVOLUME8 iface
);
618 /* IDirect3DVolume8: */
619 extern HRESULT WINAPI
IDirect3DVolume8Impl_GetDevice(LPDIRECT3DVOLUME8 iface
, IDirect3DDevice8
** ppDevice
);
620 extern HRESULT WINAPI
IDirect3DVolume8Impl_SetPrivateData(LPDIRECT3DVOLUME8 iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
);
621 extern HRESULT WINAPI
IDirect3DVolume8Impl_GetPrivateData(LPDIRECT3DVOLUME8 iface
, REFGUID refguid
, void* pData
, DWORD
* pSizeOfData
);
622 extern HRESULT WINAPI
IDirect3DVolume8Impl_FreePrivateData(LPDIRECT3DVOLUME8 iface
, REFGUID refguid
);
623 extern HRESULT WINAPI
IDirect3DVolume8Impl_GetContainer(LPDIRECT3DVOLUME8 iface
, REFIID riid
, void** ppContainer
);
624 extern HRESULT WINAPI
IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface
, D3DVOLUME_DESC
* pDesc
);
625 extern HRESULT WINAPI
IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface
, D3DLOCKED_BOX
* pLockedVolume
, CONST D3DBOX
* pBox
, DWORD Flags
);
626 extern HRESULT WINAPI
IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface
);
628 /* internal Interfaces */
629 extern HRESULT WINAPI
IDirect3DVolume8Impl_CleanDirtyBox(LPDIRECT3DVOLUME8 iface
);
630 extern HRESULT WINAPI
IDirect3DVolume8Impl_AddDirtyBox(LPDIRECT3DVOLUME8 iface
, CONST D3DBOX
* pDirtyBox
);
632 /* ------------------- */
633 /* IDirect3DSwapChain8 */
634 /* ------------------- */
636 /*****************************************************************************
637 * Predeclare the interface implementation structures
639 extern const IDirect3DSwapChain8Vtbl Direct3DSwapChain8_Vtbl
;
641 /*****************************************************************************
642 * IDirect3DSwapChain8 implementation structure
644 struct IDirect3DSwapChain8Impl
646 /* IUnknown fields */
647 const IDirect3DSwapChain8Vtbl
*lpVtbl
;
650 /* IDirect3DSwapChain8 fields */
651 IDirect3DSurface8Impl
*frontBuffer
;
652 IDirect3DSurface8Impl
*backBuffer
;
653 IDirect3DSurface8Impl
*depthStencilBuffer
;
654 D3DPRESENT_PARAMETERS PresentParms
;
656 /* OpenGL/GLX related */
658 Drawable swap_drawable
;
660 /* ready for when we move over to wined3d */
661 IWineD3DSwapChain
*wineD3DSwapChain
;
665 extern HRESULT WINAPI
IDirect3DSwapChain8Impl_QueryInterface(LPDIRECT3DSWAPCHAIN8 iface
, REFIID refiid
, LPVOID
*obj
);
666 extern ULONG WINAPI
IDirect3DSwapChain8Impl_AddRef(LPDIRECT3DSWAPCHAIN8 iface
);
667 extern ULONG WINAPI
IDirect3DSwapChain8Impl_Release(LPDIRECT3DSWAPCHAIN8 iface
);
669 /* IDirect3DSwapChain8: */
670 extern HRESULT WINAPI
IDirect3DSwapChain8Impl_Present(LPDIRECT3DSWAPCHAIN8 iface
, CONST RECT
* pSourceRect
, CONST RECT
* pDestRect
, HWND hDestWindowOverride
,CONST RGNDATA
* pDirtyRegion
);
671 extern HRESULT WINAPI
IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8 iface
, UINT BackBuffer
, D3DBACKBUFFER_TYPE Type
,IDirect3DSurface8
** ppBackBuffer
);
674 /* ----------------- */
675 /* IDirect3DSurface8 */
676 /* ----------------- */
678 /*****************************************************************************
679 * Predeclare the interface implementation structures
681 extern const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl
;
683 /*****************************************************************************
684 * IDirect3DSurface8 implementation structure
686 struct IDirect3DSurface8Impl
688 /* IUnknown fields */
689 const IDirect3DSurface8Vtbl
*lpVtbl
;
692 /* IDirect3DSurface8 fields */
693 IDirect3DDevice8Impl
*Device
;
694 D3DRESOURCETYPE ResourceType
;
697 D3DSURFACE_DESC myDesc
;
698 BYTE
*allocatedMemory
;
710 IWineD3DSurface
*wineD3DSurface
;
714 extern HRESULT WINAPI
IDirect3DSurface8Impl_QueryInterface(LPDIRECT3DSURFACE8 iface
,REFIID refiid
,LPVOID
*obj
);
715 extern ULONG WINAPI
IDirect3DSurface8Impl_AddRef(LPDIRECT3DSURFACE8 iface
);
716 extern ULONG WINAPI
IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface
);
718 /* IDirect3DSurface8: */
719 extern HRESULT WINAPI
IDirect3DSurface8Impl_GetDevice(LPDIRECT3DSURFACE8 iface
, IDirect3DDevice8
** ppDevice
);
720 extern HRESULT WINAPI
IDirect3DSurface8Impl_SetPrivateData(LPDIRECT3DSURFACE8 iface
, REFGUID refguid
,CONST
void* pData
,DWORD SizeOfData
,DWORD Flags
);
721 extern HRESULT WINAPI
IDirect3DSurface8Impl_GetPrivateData(LPDIRECT3DSURFACE8 iface
, REFGUID refguid
,void* pData
,DWORD
* pSizeOfData
);
722 extern HRESULT WINAPI
IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 iface
, REFGUID refguid
);
723 extern HRESULT WINAPI
IDirect3DSurface8Impl_GetContainer(LPDIRECT3DSURFACE8 iface
, REFIID riid
,void** ppContainer
);
724 extern HRESULT WINAPI
IDirect3DSurface8Impl_GetDesc(LPDIRECT3DSURFACE8 iface
, D3DSURFACE_DESC
*pDesc
);
725 extern HRESULT WINAPI
IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface
, D3DLOCKED_RECT
* pLockedRect
, CONST RECT
* pRect
,DWORD Flags
);
726 extern HRESULT WINAPI
IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface
);
728 /* internal Interfaces */
729 extern HRESULT WINAPI
IDirect3DSurface8Impl_LoadTexture(LPDIRECT3DSURFACE8 iface
, GLenum gl_target
, GLenum gl_level
);
730 extern HRESULT WINAPI
IDirect3DSurface8Impl_SaveSnapshot(LPDIRECT3DSURFACE8 iface
, const char* filename
);
731 extern HRESULT WINAPI
IDirect3DSurface8Impl_CleanDirtyRect(LPDIRECT3DSURFACE8 iface
);
732 extern HRESULT WINAPI
IDirect3DSurface8Impl_AddDirtyRect(LPDIRECT3DSURFACE8 iface
, CONST RECT
* pDirtyRect
);
734 /* ------------------ */
735 /* IDirect3DResource8 */
736 /* ------------------ */
738 /*****************************************************************************
739 * Predeclare the interface implementation structures
741 extern const IDirect3DResource8Vtbl Direct3DResource8_Vtbl
;
743 /*****************************************************************************
744 * IDirect3DResource8 implementation structure
746 struct IDirect3DResource8Impl
748 /* IUnknown fields */
749 const IDirect3DResource8Vtbl
*lpVtbl
;
752 /* IDirect3DResource8 fields */
753 IDirect3DDevice8Impl
*Device
;
754 D3DRESOURCETYPE ResourceType
;
758 extern HRESULT WINAPI
IDirect3DResource8Impl_QueryInterface(LPDIRECT3DRESOURCE8 iface
,REFIID refiid
,LPVOID
*obj
);
759 extern ULONG WINAPI
IDirect3DResource8Impl_AddRef(LPDIRECT3DRESOURCE8 iface
);
760 extern ULONG WINAPI
IDirect3DResource8Impl_Release(LPDIRECT3DRESOURCE8 iface
);
762 /* IDirect3DResource8: */
763 extern HRESULT WINAPI
IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface
, IDirect3DDevice8
** ppDevice
);
764 extern HRESULT WINAPI
IDirect3DResource8Impl_SetPrivateData(LPDIRECT3DRESOURCE8 iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
);
765 extern HRESULT WINAPI
IDirect3DResource8Impl_GetPrivateData(LPDIRECT3DRESOURCE8 iface
, REFGUID refguid
, void* pData
, DWORD
* pSizeOfData
);
766 extern HRESULT WINAPI
IDirect3DResource8Impl_FreePrivateData(LPDIRECT3DRESOURCE8 iface
, REFGUID refguid
);
767 extern DWORD WINAPI
IDirect3DResource8Impl_SetPriority(LPDIRECT3DRESOURCE8 iface
, DWORD PriorityNew
);
768 extern DWORD WINAPI
IDirect3DResource8Impl_GetPriority(LPDIRECT3DRESOURCE8 iface
);
769 extern void WINAPI
IDirect3DResource8Impl_PreLoad(LPDIRECT3DRESOURCE8 iface
);
770 extern D3DRESOURCETYPE WINAPI
IDirect3DResource8Impl_GetType(LPDIRECT3DRESOURCE8 iface
);
772 /* internal Interfaces */
773 extern D3DPOOL WINAPI
IDirect3DResource8Impl_GetPool(LPDIRECT3DRESOURCE8 iface
);
776 /* ---------------------- */
777 /* IDirect3DVertexBuffer8 */
778 /* ---------------------- */
780 /*****************************************************************************
781 * Predeclare the interface implementation structures
783 extern const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl
;
785 /*****************************************************************************
786 * IDirect3DVertexBuffer8 implementation structure
788 struct IDirect3DVertexBuffer8Impl
790 /* IUnknown fields */
791 const IDirect3DVertexBuffer8Vtbl
*lpVtbl
;
794 /* IDirect3DResource8 fields */
795 IDirect3DDevice8Impl
*Device
;
796 D3DRESOURCETYPE ResourceType
;
798 /* IDirect3DVertexBuffer8 fields */
799 BYTE
*allocatedMemory
;
800 D3DVERTEXBUFFER_DESC currentDesc
;
804 extern HRESULT WINAPI
IDirect3DVertexBuffer8Impl_QueryInterface(LPDIRECT3DVERTEXBUFFER8 iface
,REFIID refiid
,LPVOID
*obj
);
805 extern ULONG WINAPI
IDirect3DVertexBuffer8Impl_AddRef(LPDIRECT3DVERTEXBUFFER8 iface
);
806 extern ULONG WINAPI
IDirect3DVertexBuffer8Impl_Release(LPDIRECT3DVERTEXBUFFER8 iface
);
808 /* IDirect3DVertexBuffer8: (Inherited from IDirect3DResource8) */
809 extern HRESULT WINAPI
IDirect3DVertexBuffer8Impl_GetDevice(LPDIRECT3DVERTEXBUFFER8 iface
, IDirect3DDevice8
** ppDevice
);
810 extern HRESULT WINAPI
IDirect3DVertexBuffer8Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
);
811 extern HRESULT WINAPI
IDirect3DVertexBuffer8Impl_GetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface
, REFGUID refguid
, void* pData
, DWORD
* pSizeOfData
);
812 extern HRESULT WINAPI
IDirect3DVertexBuffer8Impl_FreePrivateData(LPDIRECT3DVERTEXBUFFER8 iface
, REFGUID refguid
);
813 extern DWORD WINAPI
IDirect3DVertexBuffer8Impl_SetPriority(LPDIRECT3DVERTEXBUFFER8 iface
, DWORD PriorityNew
);
814 extern DWORD WINAPI
IDirect3DVertexBuffer8Impl_GetPriority(LPDIRECT3DVERTEXBUFFER8 iface
);
815 extern void WINAPI
IDirect3DVertexBuffer8Impl_PreLoad(LPDIRECT3DVERTEXBUFFER8 iface
);
816 extern D3DRESOURCETYPE WINAPI
IDirect3DVertexBuffer8Impl_GetType(LPDIRECT3DVERTEXBUFFER8 iface
);
818 /* IDirect3DVertexBuffer8: */
819 extern HRESULT WINAPI
IDirect3DVertexBuffer8Impl_Lock(LPDIRECT3DVERTEXBUFFER8 iface
, UINT OffsetToLock
, UINT SizeToLock
, BYTE
** ppbData
, DWORD Flags
);
820 extern HRESULT WINAPI
IDirect3DVertexBuffer8Impl_Unlock(LPDIRECT3DVERTEXBUFFER8 iface
);
821 extern HRESULT WINAPI
IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8 iface
, D3DVERTEXBUFFER_DESC
*pDesc
);
824 /* --------------------- */
825 /* IDirect3DIndexBuffer8 */
826 /* --------------------- */
828 /*****************************************************************************
829 * Predeclare the interface implementation structures
831 extern const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl
;
833 /*****************************************************************************
834 * IDirect3DIndexBuffer8 implementation structure
836 struct IDirect3DIndexBuffer8Impl
838 /* IUnknown fields */
839 const IDirect3DIndexBuffer8Vtbl
*lpVtbl
;
842 /* IDirect3DResource8 fields */
843 IDirect3DDevice8Impl
*Device
;
844 D3DRESOURCETYPE ResourceType
;
846 /* IDirect3DIndexBuffer8 fields */
847 void *allocatedMemory
;
848 D3DINDEXBUFFER_DESC currentDesc
;
852 extern HRESULT WINAPI
IDirect3DIndexBuffer8Impl_QueryInterface(LPDIRECT3DINDEXBUFFER8 iface
,REFIID refiid
,LPVOID
*obj
);
853 extern ULONG WINAPI
IDirect3DIndexBuffer8Impl_AddRef(LPDIRECT3DINDEXBUFFER8 iface
);
854 extern ULONG WINAPI
IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 iface
);
856 /* IDirect3DIndexBuffer8: (Inherited from IDirect3DResource8) */
857 extern HRESULT WINAPI
IDirect3DIndexBuffer8Impl_GetDevice(LPDIRECT3DINDEXBUFFER8 iface
, IDirect3DDevice8
** ppDevice
);
858 extern HRESULT WINAPI
IDirect3DIndexBuffer8Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER8 iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
);
859 extern HRESULT WINAPI
IDirect3DIndexBuffer8Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER8 iface
, REFGUID refguid
, void* pData
, DWORD
* pSizeOfData
);
860 extern HRESULT WINAPI
IDirect3DIndexBuffer8Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER8 iface
, REFGUID refguid
);
861 extern DWORD WINAPI
IDirect3DIndexBuffer8Impl_SetPriority(LPDIRECT3DINDEXBUFFER8 iface
, DWORD PriorityNew
);
862 extern DWORD WINAPI
IDirect3DIndexBuffer8Impl_GetPriority(LPDIRECT3DINDEXBUFFER8 iface
);
863 extern void WINAPI
IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 iface
);
864 extern D3DRESOURCETYPE WINAPI
IDirect3DIndexBuffer8Impl_GetType(LPDIRECT3DINDEXBUFFER8 iface
);
866 /* IDirect3DIndexBuffer8: */
867 extern HRESULT WINAPI
IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 iface
, UINT OffsetToLock
, UINT SizeToLock
, BYTE
** ppbData
, DWORD Flags
);
868 extern HRESULT WINAPI
IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 iface
);
869 extern HRESULT WINAPI
IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 iface
, D3DINDEXBUFFER_DESC
*pDesc
);
872 /* --------------------- */
873 /* IDirect3DBaseTexture8 */
874 /* --------------------- */
876 /*****************************************************************************
877 * IDirect3DBaseTexture8 implementation structure
879 struct IDirect3DBaseTexture8Impl
881 /* IUnknown fields */
882 const IDirect3DBaseTexture8Vtbl
*lpVtbl
;
885 /* IDirect3DResource8 fields */
886 IDirect3DDevice8Impl
*Device
;
887 D3DRESOURCETYPE ResourceType
;
889 /* IDirect3DBaseTexture8 fields */
900 extern HRESULT WINAPI
IDirect3DBaseTexture8Impl_QueryInterface(LPDIRECT3DBASETEXTURE8 iface
,REFIID refiid
,LPVOID
*obj
);
901 extern ULONG WINAPI
IDirect3DBaseTexture8Impl_AddRef(LPDIRECT3DBASETEXTURE8 iface
);
902 extern ULONG WINAPI
IDirect3DBaseTexture8Impl_Release(LPDIRECT3DBASETEXTURE8 iface
);
904 /* IDirect3DBaseTexture8: (Inherited from IDirect3DResource8) */
905 extern HRESULT WINAPI
IDirect3DBaseTexture8Impl_GetDevice(LPDIRECT3DBASETEXTURE8 iface
, IDirect3DDevice8
** ppDevice
);
906 extern HRESULT WINAPI
IDirect3DBaseTexture8Impl_SetPrivateData(LPDIRECT3DBASETEXTURE8 iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
);
907 extern HRESULT WINAPI
IDirect3DBaseTexture8Impl_GetPrivateData(LPDIRECT3DBASETEXTURE8 iface
, REFGUID refguid
, void* pData
, DWORD
* pSizeOfData
);
908 extern HRESULT WINAPI
IDirect3DBaseTexture8Impl_FreePrivateData(LPDIRECT3DBASETEXTURE8 iface
, REFGUID refguid
);
909 extern DWORD WINAPI
IDirect3DBaseTexture8Impl_SetPriority(LPDIRECT3DBASETEXTURE8 iface
, DWORD PriorityNew
);
910 extern DWORD WINAPI
IDirect3DBaseTexture8Impl_GetPriority(LPDIRECT3DBASETEXTURE8 iface
);
911 extern void WINAPI
IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8 iface
);
912 extern D3DRESOURCETYPE WINAPI
IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8 iface
);
914 /* IDirect3DBaseTexture8: */
915 extern DWORD WINAPI
IDirect3DBaseTexture8Impl_SetLOD(LPDIRECT3DBASETEXTURE8 iface
, DWORD LODNew
);
916 extern DWORD WINAPI
IDirect3DBaseTexture8Impl_GetLOD(LPDIRECT3DBASETEXTURE8 iface
);
917 extern DWORD WINAPI
IDirect3DBaseTexture8Impl_GetLevelCount(LPDIRECT3DBASETEXTURE8 iface
);
919 /* internal Interfaces */
920 extern BOOL WINAPI
IDirect3DBaseTexture8Impl_IsDirty(LPDIRECT3DBASETEXTURE8 iface
);
921 extern BOOL WINAPI
IDirect3DBaseTexture8Impl_SetDirty(LPDIRECT3DBASETEXTURE8 iface
, BOOL dirty
);
924 /* --------------------- */
925 /* IDirect3DCubeTexture8 */
926 /* --------------------- */
928 /*****************************************************************************
929 * Predeclare the interface implementation structures
931 extern const IDirect3DCubeTexture8Vtbl Direct3DCubeTexture8_Vtbl
;
933 /*****************************************************************************
934 * IDirect3DCubeTexture8 implementation structure
936 struct IDirect3DCubeTexture8Impl
938 /* IUnknown fields */
939 const IDirect3DCubeTexture8Vtbl
*lpVtbl
;
942 /* IDirect3DResource8 fields */
943 IDirect3DDevice8Impl
*Device
;
944 D3DRESOURCETYPE ResourceType
;
946 /* IDirect3DBaseTexture8 fields */
951 /* IDirect3DCubeTexture8 fields */
955 IDirect3DSurface8Impl
*surfaces
[6][MAX_LEVELS
];
959 extern HRESULT WINAPI
IDirect3DCubeTexture8Impl_QueryInterface(LPDIRECT3DCUBETEXTURE8 iface
,REFIID refiid
,LPVOID
*obj
);
960 extern ULONG WINAPI
IDirect3DCubeTexture8Impl_AddRef(LPDIRECT3DCUBETEXTURE8 iface
);
961 extern ULONG WINAPI
IDirect3DCubeTexture8Impl_Release(LPDIRECT3DCUBETEXTURE8 iface
);
963 /* IDirect3DCubeTexture8: (Inherited from IDirect3DResource8) */
964 extern HRESULT WINAPI
IDirect3DCubeTexture8Impl_GetDevice(LPDIRECT3DCUBETEXTURE8 iface
, IDirect3DDevice8
** ppDevice
);
965 extern HRESULT WINAPI
IDirect3DCubeTexture8Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE8 iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
);
966 extern HRESULT WINAPI
IDirect3DCubeTexture8Impl_GetPrivateData(LPDIRECT3DCUBETEXTURE8 iface
, REFGUID refguid
, void* pData
, DWORD
* pSizeOfData
);
967 extern HRESULT WINAPI
IDirect3DCubeTexture8Impl_FreePrivateData(LPDIRECT3DCUBETEXTURE8 iface
, REFGUID refguid
);
968 extern DWORD WINAPI
IDirect3DCubeTexture8Impl_SetPriority(LPDIRECT3DCUBETEXTURE8 iface
, DWORD PriorityNew
);
969 extern DWORD WINAPI
IDirect3DCubeTexture8Impl_GetPriority(LPDIRECT3DCUBETEXTURE8 iface
);
970 extern void WINAPI
IDirect3DCubeTexture8Impl_PreLoad(LPDIRECT3DCUBETEXTURE8 iface
);
971 extern D3DRESOURCETYPE WINAPI
IDirect3DCubeTexture8Impl_GetType(LPDIRECT3DCUBETEXTURE8 iface
);
973 /* IDirect3DCubeTexture8: (Inherited from IDirect3DBaseTexture8) */
974 extern DWORD WINAPI
IDirect3DCubeTexture8Impl_SetLOD(LPDIRECT3DCUBETEXTURE8 iface
, DWORD LODNew
);
975 extern DWORD WINAPI
IDirect3DCubeTexture8Impl_GetLOD(LPDIRECT3DCUBETEXTURE8 iface
);
976 extern DWORD WINAPI
IDirect3DCubeTexture8Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE8 iface
);
978 /* IDirect3DCubeTexture8 */
979 extern HRESULT WINAPI
IDirect3DCubeTexture8Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE8 iface
, UINT Level
, D3DSURFACE_DESC
* pDesc
);
980 extern HRESULT WINAPI
IDirect3DCubeTexture8Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE8 iface
, D3DCUBEMAP_FACES FaceType
, UINT Level
, IDirect3DSurface8
** ppCubeMapSurface
);
981 extern HRESULT WINAPI
IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8 iface
, D3DCUBEMAP_FACES FaceType
, UINT Level
, D3DLOCKED_RECT
* pLockedRect
, CONST RECT
* pRect
, DWORD Flags
);
982 extern HRESULT WINAPI
IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE8 iface
, D3DCUBEMAP_FACES FaceType
, UINT Level
);
983 extern HRESULT WINAPI
IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXTURE8 iface
, D3DCUBEMAP_FACES FaceType
, CONST RECT
* pDirtyRect
);
986 /* ----------------- */
987 /* IDirect3DTexture8 */
988 /* ----------------- */
990 /*****************************************************************************
991 * Predeclare the interface implementation structures
993 extern const IDirect3DTexture8Vtbl Direct3DTexture8_Vtbl
;
995 /*****************************************************************************
996 * IDirect3DTexture8 implementation structure
998 struct IDirect3DTexture8Impl
1000 /* IUnknown fields */
1001 const IDirect3DTexture8Vtbl
*lpVtbl
;
1004 /* IDirect3DResourc8 fields */
1005 IDirect3DDevice8Impl
*Device
;
1006 D3DRESOURCETYPE ResourceType
;
1008 /* IDirect3DBaseTexture8 fields */
1013 /* IDirect3DTexture8 fields */
1018 IDirect3DSurface8Impl
*surfaces
[MAX_LEVELS
];
1022 extern HRESULT WINAPI
IDirect3DTexture8Impl_QueryInterface(LPDIRECT3DTEXTURE8 iface
,REFIID refiid
,LPVOID
*obj
);
1023 extern ULONG WINAPI
IDirect3DTexture8Impl_AddRef(LPDIRECT3DTEXTURE8 iface
);
1024 extern ULONG WINAPI
IDirect3DTexture8Impl_Release(LPDIRECT3DTEXTURE8 iface
);
1026 /* IDirect3DTexture8: (Inherited from IDirect3DResource8) */
1027 extern HRESULT WINAPI
IDirect3DTexture8Impl_GetDevice(LPDIRECT3DTEXTURE8 iface
, IDirect3DDevice8
** ppDevice
);
1028 extern HRESULT WINAPI
IDirect3DTexture8Impl_SetPrivateData(LPDIRECT3DTEXTURE8 iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
);
1029 extern HRESULT WINAPI
IDirect3DTexture8Impl_GetPrivateData(LPDIRECT3DTEXTURE8 iface
, REFGUID refguid
, void* pData
, DWORD
* pSizeOfData
);
1030 extern HRESULT WINAPI
IDirect3DTexture8Impl_FreePrivateData(LPDIRECT3DTEXTURE8 iface
, REFGUID refguid
);
1031 extern DWORD WINAPI
IDirect3DTexture8Impl_SetPriority(LPDIRECT3DTEXTURE8 iface
, DWORD PriorityNew
);
1032 extern DWORD WINAPI
IDirect3DTexture8Impl_GetPriority(LPDIRECT3DTEXTURE8 iface
);
1033 extern void WINAPI
IDirect3DTexture8Impl_PreLoad(LPDIRECT3DTEXTURE8 iface
);
1034 extern D3DRESOURCETYPE WINAPI
IDirect3DTexture8Impl_GetType(LPDIRECT3DTEXTURE8 iface
);
1036 /* IDirect3DTexture8: (Inherited from IDirect3DBaseTexture8) */
1037 extern DWORD WINAPI
IDirect3DTexture8Impl_SetLOD(LPDIRECT3DTEXTURE8 iface
, DWORD LODNew
);
1038 extern DWORD WINAPI
IDirect3DTexture8Impl_GetLOD(LPDIRECT3DTEXTURE8 iface
);
1039 extern DWORD WINAPI
IDirect3DTexture8Impl_GetLevelCount(LPDIRECT3DTEXTURE8 iface
);
1041 /* IDirect3DTexture8: */
1042 extern HRESULT WINAPI
IDirect3DTexture8Impl_GetLevelDesc(LPDIRECT3DTEXTURE8 iface
, UINT Level
, D3DSURFACE_DESC
* pDesc
);
1043 extern HRESULT WINAPI
IDirect3DTexture8Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE8 iface
, UINT Level
, IDirect3DSurface8
** ppSurfaceLevel
);
1044 extern HRESULT WINAPI
IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface
, UINT Level
, D3DLOCKED_RECT
* pLockedRect
, CONST RECT
* pRect
, DWORD Flags
);
1045 extern HRESULT WINAPI
IDirect3DTexture8Impl_UnlockRect(LPDIRECT3DTEXTURE8 iface
, UINT Level
);
1046 extern HRESULT WINAPI
IDirect3DTexture8Impl_AddDirtyRect(LPDIRECT3DTEXTURE8 iface
, CONST RECT
* pDirtyRect
);
1049 /* ----------------------- */
1050 /* IDirect3DVolumeTexture8 */
1051 /* ----------------------- */
1053 /*****************************************************************************
1054 * Predeclare the interface implementation structures
1056 extern const IDirect3DVolumeTexture8Vtbl Direct3DVolumeTexture8_Vtbl
;
1058 /*****************************************************************************
1059 * IDirect3DVolumeTexture8 implementation structure
1061 struct IDirect3DVolumeTexture8Impl
1063 /* IUnknown fields */
1064 const IDirect3DVolumeTexture8Vtbl
*lpVtbl
;
1067 /* IDirect3DResource8 fields */
1068 IDirect3DDevice8Impl
*Device
;
1069 D3DRESOURCETYPE ResourceType
;
1071 /* IDirect3DBaseTexture8 fields */
1076 /* IDirect3DVolumeTexture8 fields */
1082 IDirect3DVolume8Impl
*volumes
[MAX_LEVELS
];
1086 extern HRESULT WINAPI
IDirect3DVolumeTexture8Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE8 iface
,REFIID refiid
,LPVOID
*obj
);
1087 extern ULONG WINAPI
IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8 iface
);
1088 extern ULONG WINAPI
IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8 iface
);
1090 /* IDirect3DVolumeTexture8: (Inherited from IDirect3DResource8) */
1091 extern HRESULT WINAPI
IDirect3DVolumeTexture8Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE8 iface
, IDirect3DDevice8
** ppDevice
);
1092 extern HRESULT WINAPI
IDirect3DVolumeTexture8Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface
, REFGUID refguid
, CONST
void* pData
, DWORD SizeOfData
, DWORD Flags
);
1093 extern HRESULT WINAPI
IDirect3DVolumeTexture8Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface
, REFGUID refguid
, void* pData
, DWORD
* pSizeOfData
);
1094 extern HRESULT WINAPI
IDirect3DVolumeTexture8Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE8 iface
, REFGUID refguid
);
1095 extern DWORD WINAPI
IDirect3DVolumeTexture8Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE8 iface
, DWORD PriorityNew
);
1096 extern DWORD WINAPI
IDirect3DVolumeTexture8Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE8 iface
);
1097 extern void WINAPI
IDirect3DVolumeTexture8Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE8 iface
);
1098 extern D3DRESOURCETYPE WINAPI
IDirect3DVolumeTexture8Impl_GetType(LPDIRECT3DVOLUMETEXTURE8 iface
);
1100 /* IDirect3DVolumeTexture8: (Inherited from IDirect3DBaseTexture8) */
1101 extern DWORD WINAPI
IDirect3DVolumeTexture8Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE8 iface
, DWORD LODNew
);
1102 extern DWORD WINAPI
IDirect3DVolumeTexture8Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE8 iface
);
1103 extern DWORD WINAPI
IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE8 iface
);
1105 /* IDirect3DVolumeTexture8: */
1106 extern HRESULT WINAPI
IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface
, UINT Level
, D3DVOLUME_DESC
*pDesc
);
1107 extern HRESULT WINAPI
IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface
, UINT Level
, IDirect3DVolume8
** ppVolumeLevel
);
1108 extern HRESULT WINAPI
IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface
, UINT Level
, D3DLOCKED_BOX
* pLockedVolume
, CONST D3DBOX
* pBox
, DWORD Flags
);
1109 extern HRESULT WINAPI
IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface
, UINT Level
);
1110 extern HRESULT WINAPI
IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE8 iface
, CONST D3DBOX
* pDirtyBox
);
1113 /* ==============================================================================
1114 Private interfactes: beginning of cleaning/splitting for HAL and d3d9 support
1115 ============================================================================== */
1117 /* State Block for Begin/End/Capture/Create/Apply State Block */
1118 /* Note: Very long winded but I do not believe gl Lists will */
1119 /* resolve everything we need, so doing it manually for now */
1120 typedef struct SAVEDSTATES
{
1123 BOOL stream_source
[MAX_STREAMS
];
1125 BOOL transform
[HIGHEST_TRANSFORMSTATE
];
1128 BOOL vertexShaderConstant
;
1129 BOOL vertexShaderDecl
;
1131 BOOL pixelShaderConstant
;
1132 BOOL renderstate
[HIGHEST_RENDER_STATE
];
1133 BOOL texture_state
[8][HIGHEST_TEXTURE_STATE
];
1134 BOOL clipplane
[MAX_CLIPPLANES
];
1138 /* ----------------------- */
1139 /* IDirect3DStateBlockImpl */
1140 /* ----------------------- */
1142 /*****************************************************************************
1143 * Predeclare the interface implementation structures
1145 /*extern const IDirect3DStateBlock9Vtbl Direct3DStateBlock9_Vtbl;*/
1147 /*****************************************************************************
1148 * IDirect3DStateBlock implementation structure
1150 struct IDirect3DStateBlockImpl
{
1151 /* IUnknown fields */
1152 /*const IDirect3DStateBlock9Vtbl *lpVtbl;*/
1155 /* The device, to be replaced by an IDirect3DDeviceImpl */
1156 IDirect3DDevice8Impl
* device
;
1158 D3DSTATEBLOCKTYPE blockType
;
1160 SAVEDSTATES Changed
;
1164 double clipplane
[MAX_CLIPPLANES
][4];
1165 D3DCLIPSTATUS8 clip_status
;
1168 UINT stream_stride
[MAX_STREAMS
];
1169 IDirect3DVertexBuffer8
*stream_source
[MAX_STREAMS
];
1173 IDirect3DIndexBuffer8
* pIndexData
;
1174 UINT baseVertexIndex
;
1177 IDirect3DBaseTexture8
*textures
[8];
1178 int textureDimensions
[8];
1179 /* Texture State Stage */
1180 DWORD texture_state
[8][HIGHEST_TEXTURE_STATE
];
1183 PLIGHTINFOEL
*lights
; /* NOTE: active GL lights must be front of the chain */
1186 D3DMATERIAL8 material
;
1189 DWORD renderstate
[HIGHEST_RENDER_STATE
];
1192 D3DMATRIX transforms
[HIGHEST_TRANSFORMSTATE
];
1195 D3DVIEWPORT8 viewport
;
1200 /* Vertex Shader Declaration */
1201 IDirect3DVertexShaderDeclarationImpl
* vertexShaderDecl
;
1206 /* Indexed Vertex Blending */
1207 D3DVERTEXBLENDFLAGS vertex_blend
;
1210 /* Vertex Shader Constant */
1211 D3DSHADERVECTOR vertexShaderConstant
[D3D8_VSHADER_MAX_CONSTANTS
];
1212 /* Pixel Shader Constant */
1213 D3DSHADERVECTOR pixelShaderConstant
[D3D8_PSHADER_MAX_CONSTANTS
];
1216 /* exported Interfaces */
1217 /* internal Interfaces */
1218 /* temporary internal Interfaces */
1219 extern HRESULT WINAPI
IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl
* This
);
1220 extern HRESULT WINAPI
IDirect3DDeviceImpl_CreateStateBlock(IDirect3DDevice8Impl
* This
, D3DSTATEBLOCKTYPE Type
, IDirect3DStateBlockImpl
** ppStateBlock
);
1221 extern HRESULT WINAPI
IDirect3DDeviceImpl_DeleteStateBlock(IDirect3DDevice8Impl
* This
, IDirect3DStateBlockImpl
* pSB
);
1222 extern HRESULT WINAPI
IDirect3DDeviceImpl_BeginStateBlock(IDirect3DDevice8Impl
* This
);
1223 extern HRESULT WINAPI
IDirect3DDeviceImpl_EndStateBlock(IDirect3DDevice8Impl
* This
, IDirect3DStateBlockImpl
** ppStateBlock
);
1224 extern HRESULT WINAPI
IDirect3DDeviceImpl_ApplyStateBlock(IDirect3DDevice8Impl
* iface
, IDirect3DStateBlockImpl
* pSB
);
1225 extern HRESULT WINAPI
IDirect3DDeviceImpl_CaptureStateBlock(IDirect3DDevice8Impl
* This
, IDirect3DStateBlockImpl
* pSB
);
1227 /* ------------------------------------ */
1228 /* IDirect3DVertexShaderDeclarationImpl */
1229 /* ------------------------------------ */
1231 /*****************************************************************************
1232 * Predeclare the interface implementation structures
1234 /*extern const IDirect3DVertexShaderDeclaration9Vtbl Direct3DVertexShaderDeclaration9_Vtbl;*/
1236 /*****************************************************************************
1237 * IDirect3DVertexShaderDeclaration implementation structure
1239 struct IDirect3DVertexShaderDeclarationImpl
{
1240 /* IUnknown fields */
1241 /*const IDirect3DVertexShaderDeclaration9Vtbl *lpVtbl;*/
1244 /* The device, to be replaced by an IDirect3DDeviceImpl */
1245 IDirect3DDevice8Impl
* device
;
1247 /** precomputed fvf if simple declaration */
1248 DWORD fvf
[MAX_STREAMS
];
1251 /** dx8 compatible Declaration fields */
1252 DWORD
* pDeclaration8
;
1253 DWORD declaration8Length
;
1256 /* exported Interfaces */
1257 extern HRESULT WINAPI
IDirect3DVertexShaderDeclarationImpl_GetDeclaration8(IDirect3DVertexShaderDeclarationImpl
* This
, DWORD
* pData
, UINT
* pSizeOfData
);
1258 /*extern HRESULT IDirect3DVertexShaderDeclarationImpl_GetDeclaration9(IDirect3DVertexShaderDeclarationImpl* This, D3DVERTEXELEMENT9* pData, UINT* pNumElements);*/
1259 /* internal Interfaces */
1260 /* temporary internal Interfaces */
1261 extern HRESULT WINAPI
IDirect3DDeviceImpl_CreateVertexShaderDeclaration8(IDirect3DDevice8Impl
* This
, CONST DWORD
* pDeclaration8
, IDirect3DVertexShaderDeclarationImpl
** ppVertexShaderDecl
);
1264 /* ------------------------- */
1265 /* IDirect3DVertexShaderImpl */
1266 /* ------------------------- */
1268 /*****************************************************************************
1269 * Predeclare the interface implementation structures
1271 /*extern const IDirect3DVertexShader9Vtbl Direct3DVertexShader9_Vtbl;*/
1273 /*****************************************************************************
1274 * IDirect3DVertexShader implementation structure
1276 struct IDirect3DVertexShaderImpl
{
1277 /*const IDirect3DVertexShader9Vtbl *lpVtbl;*/
1280 /* The device, to be replaced by an IDirect3DDeviceImpl */
1281 IDirect3DDevice8Impl
* device
;
1284 UINT functionLength
;
1285 DWORD usage
; /* 0 || D3DUSAGE_SOFTWAREPROCESSING */
1288 /** fields for hw vertex shader use */
1291 /* run time datas */
1293 VSHADERINPUTDATA8 input
;
1294 VSHADEROUTPUTDATA8 output
;
1297 /* exported Interfaces */
1298 extern HRESULT WINAPI
IDirect3DVertexShaderImpl_GetFunction(IDirect3DVertexShaderImpl
* This
, VOID
* pData
, UINT
* pSizeOfData
);
1299 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);*/
1300 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST INT* pConstantData, UINT Vector4iCount);*/
1301 extern HRESULT WINAPI
IDirect3DVertexShaderImpl_SetConstantF(IDirect3DVertexShaderImpl
* This
, UINT StartRegister
, CONST FLOAT
* pConstantData
, UINT Vector4fCount
);
1302 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);*/
1303 /*extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, INT* pConstantData, UINT Vector4iCount);*/
1304 extern HRESULT WINAPI
IDirect3DVertexShaderImpl_GetConstantF(IDirect3DVertexShaderImpl
* This
, UINT StartRegister
, FLOAT
* pConstantData
, UINT Vector4fCount
);
1305 /* internal Interfaces */
1306 extern DWORD WINAPI
IDirect3DVertexShaderImpl_GetVersion(IDirect3DVertexShaderImpl
* This
);
1307 extern HRESULT WINAPI
IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl
* This
, VSHADERINPUTDATA8
* input
, VSHADEROUTPUTDATA8
* output
);
1308 /* temporary internal Interfaces */
1309 extern HRESULT WINAPI
IDirect3DDeviceImpl_CreateVertexShader(IDirect3DDevice8Impl
* This
, CONST DWORD
* pFunction
, DWORD Usage
, IDirect3DVertexShaderImpl
** ppVertexShader
);
1310 extern HRESULT WINAPI
IDirect3DDeviceImpl_FillVertexShaderInputSW(IDirect3DDevice8Impl
* This
, IDirect3DVertexShaderImpl
* vshader
, DWORD SkipnStrides
);
1311 extern HRESULT WINAPI
IDirect3DDeviceImpl_FillVertexShaderInputArbHW(IDirect3DDevice8Impl
* This
, IDirect3DVertexShaderImpl
* vshader
, DWORD SkipnStrides
);
1313 /* ------------------------ */
1314 /* IDirect3DPixelShaderImpl */
1315 /* ------------------------ */
1317 /*****************************************************************************
1318 * Predeclare the interface implementation structures
1320 /*extern const IDirect3DPixelShader9Vtbl Direct3DPixelShader9_Vtbl;*/
1322 /*****************************************************************************
1323 * IDirect3DPixelShader implementation structure
1325 struct IDirect3DPixelShaderImpl
{
1326 /*const IDirect3DPixelShader9Vtbl *lpVtbl;*/
1329 /* The device, to be replaced by an IDirect3DDeviceImpl */
1330 IDirect3DDevice8Impl
* device
;
1333 UINT functionLength
;
1336 /** fields for hw pixel shader use */
1339 /* run time datas */
1341 PSHADERINPUTDATA8 input
;
1342 PSHADEROUTPUTDATA8 output
;
1345 /* exported Interfaces */
1346 extern HRESULT WINAPI
IDirect3DPixelShaderImpl_GetFunction(IDirect3DPixelShaderImpl
* This
, VOID
* pData
, UINT
* pSizeOfData
);
1347 extern HRESULT WINAPI
IDirect3DPixelShaderImpl_SetConstantF(IDirect3DPixelShaderImpl
* This
, UINT StartRegister
, CONST FLOAT
* pConstantData
, UINT Vector4fCount
);
1348 /* internal Interfaces */
1349 extern DWORD WINAPI
IDirect3DPixelShaderImpl_GetVersion(IDirect3DPixelShaderImpl
* This
);
1350 /* temporary internal Interfaces */
1351 extern HRESULT WINAPI
IDirect3DDeviceImpl_CreatePixelShader(IDirect3DDevice8Impl
* This
, CONST DWORD
* pFunction
, IDirect3DPixelShaderImpl
** ppPixelShader
);
1355 * Internals functions
1357 * to see how not defined it here
1359 void GetSrcAndOpFromValue(DWORD iValue
, BOOL isAlphaArg
, GLenum
* source
, GLenum
* operand
);
1360 void setupTextureStates(LPDIRECT3DDEVICE8 iface
, DWORD Stage
, DWORD Flags
);
1361 void set_tex_op(LPDIRECT3DDEVICE8 iface
, BOOL isAlpha
, int Stage
, D3DTEXTUREOP op
, DWORD arg1
, DWORD arg2
, DWORD arg3
);
1363 SHORT
D3DFmtGetBpp(IDirect3DDevice8Impl
* This
, D3DFORMAT fmt
);
1364 GLint
D3DFmt2GLIntFmt(IDirect3DDevice8Impl
* This
, D3DFORMAT fmt
);
1365 GLenum
D3DFmt2GLFmt(IDirect3DDevice8Impl
* This
, D3DFORMAT fmt
);
1366 GLenum
D3DFmt2GLType(IDirect3DDevice8Impl
* This
, D3DFORMAT fmt
);
1368 GLenum
D3DFmt2GLDepthFmt(D3DFORMAT fmt
);
1369 GLenum
D3DFmt2GLDepthType(D3DFORMAT fmt
);
1371 int D3DPrimitiveListGetVertexSize(D3DPRIMITIVETYPE PrimitiveType
, int iNumPrim
);
1372 int D3DPrimitive2GLenum(D3DPRIMITIVETYPE PrimitiveType
);
1373 int D3DFVFGetSize(D3DFORMAT fvf
);
1375 int SOURCEx_RGB_EXT(DWORD arg
);
1376 int OPERANDx_RGB_EXT(DWORD arg
);
1377 int SOURCEx_ALPHA_EXT(DWORD arg
);
1378 int OPERANDx_ALPHA_EXT(DWORD arg
);
1379 GLenum
StencilOp(DWORD op
);
1382 * Internals debug functions
1384 const char* debug_d3ddevicetype(D3DDEVTYPE devtype
);
1385 const char* debug_d3dusage(DWORD usage
);
1386 const char* debug_d3dformat(D3DFORMAT fmt
);
1387 const char* debug_d3dressourcetype(D3DRESOURCETYPE res
);
1388 const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType
);
1389 const char* debug_d3dpool(D3DPOOL Pool
);
1390 const char *debug_d3drenderstate(DWORD State
);
1391 const char *debug_d3dtexturestate(DWORD State
);
1393 /* Some #defines for additional diagnostics */
1394 #if 0 /* NOTE: Must be 0 in cvs */
1395 /* To avoid having to get gigabytes of trace, the following can be compiled in, and at the start
1396 of each frame, a check is made for the existence of C:\D3DTRACE, and if if exists d3d trace
1397 is enabled, and if it doesn't exists it is disabled. */
1398 # define FRAME_DEBUGGING
1399 /* Adding in the SINGLE_FRAME_DEBUGGING gives a trace of just what makes up a single frame, before
1400 the file is deleted */
1401 # if 1 /* NOTE: Must be 1 in cvs, as this is mostly more useful than a trace from program start */
1402 # define SINGLE_FRAME_DEBUGGING
1404 /* The following, when enabled, lets you see the makeup of the frame, by drawprimitive calls.
1405 It can only be enabled when FRAME_DEBUGGING is also enabled
1406 The contents of the back buffer are written into /tmp/backbuffer_* after each primitive
1408 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
1409 # define SHOW_FRAME_MAKEUP 1
1411 /* The following, when enabled, lets you see the makeup of the all the textures used during each
1412 of the drawprimitive calls. It can only be enabled when SHOW_FRAME_MAKEUP is also enabled.
1413 The contents of the textures assigned to each stage are written into
1414 /tmp/texture_*_<Stage>.ppm after each primitive array is drawn. */
1415 # if 0 /* NOTE: Must be 0 in cvs, as this give a lot of ppm files when compiled in */
1416 # define SHOW_TEXTURE_MAKEUP 0
1419 extern BOOL isDumpingFrames
;
1420 extern LONG primCounter
;
1423 /* Per-vertex trace: */
1424 #if 0 /* NOTE: Must be 0 in cvs */
1425 # define VTRACE(A) TRACE A
1430 #define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w);
1431 #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);
1433 #define DUMP_LIGHT_CHAIN() \
1435 PLIGHTINFOEL *el = This->StateBlock->lights;\
1437 TRACE("Light %p (glIndex %ld, d3dIndex %ld, enabled %d)\n", el, el->glIndex, el->OriginalIndex, el->lightEnabled);\
1442 #endif /* __WINE_D3DX8_PRIVATE_H */