2 * Direct3D wine internal public interface file
4 * Copyright 2002-2003 The wine-d3d team
5 * Copyright 2002-2003 Raphael Junqueira
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __WINE_WINED3D_INTERFACE_H
23 #define __WINE_WINED3D_INTERFACE_H
25 #if !defined( __WINE_CONFIG_H )
26 # error You must include config.h to use this header
29 #if !defined( __WINE_D3D8_H ) && !defined( __WINE_D3D9_H )
30 # error You must include d3d8.h or d3d9.h header to use this header
33 /*****************************************************************
34 * THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES
35 * PLEASE USE wine/wined3d_gl.h INSTEAD
39 /*****************************************************************************
43 typedef struct _WINED3DADAPTER_IDENTIFIER {
47 LARGE_INTEGER *DriverVersion;
52 GUID *DeviceIdentifier;
54 } WINED3DADAPTER_IDENTIFIER;
58 /*****************************************************************************
61 typedef struct IWineD3D IWineD3D;
63 #define INTERFACE IWineD3D
64 #define IWineD3D_METHODS \
66 STDMETHOD_(UINT,GetAdapterCount )(THIS) PURE; \
67 STDMETHOD(RegisterSoftwareDevice)(THIS_ void * pInitializeFunction) PURE; \
68 STDMETHOD_(HMONITOR,GetAdapterMonitor)(THIS_ UINT Adapter) PURE; \
69 STDMETHOD_(UINT,GetAdapterModeCount)(THIS_ UINT Adapter, D3DFORMAT Format) PURE; \
70 STDMETHOD(EnumAdapterModes)(THIS_ UINT Adapter, UINT Mode, D3DFORMAT Format, D3DDISPLAYMODE * pMode) PURE; \
71 STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT Adapter, D3DDISPLAYMODE * pMode) PURE; \
72 STDMETHOD(GetAdapterIdentifier)(THIS_ UINT Adapter, DWORD Flags, WINED3DADAPTER_IDENTIFIER* pIdentifier) PURE; \
73 STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD *pQuality) PURE; \
74 STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) PURE; \
75 STDMETHOD(CheckDeviceType)(THIS_ UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat, D3DFORMAT BackBufferFormat, BOOL Windowed) PURE; \
76 STDMETHOD(CheckDeviceFormat)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) PURE; \
77 STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) PURE; \
79 DECLARE_INTERFACE_(IWineD3D,IUnknown) { IWineD3D_METHODS };
82 #if !defined(__cplusplus) || defined(CINTERFACE)
83 /*** IUnknown methods ***/
84 #define IWineD3D_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
85 #define IWineD3D_AddRef(p) (p)->lpVtbl->AddRef(p)
86 #define IWineD3D_Release(p) (p)->lpVtbl->Release(p)
87 /*** IWineD3D methods ***/
88 #define IWineD3D_GetAdapterCount(p) (p)->lpVtbl->GetAdapterCount(p)
89 #define IWineD3D_RegisterSoftwareDevice(p,a) (p)->lpVtbl->RegisterSoftwareDevice(p,a)
90 #define IWineD3D_GetAdapterMonitor(p,a) (p)->lpVtbl->GetAdapterMonitor(p,a)
91 #define IWineD3D_GetAdapterModeCount(p,a,b) (p)->lpVtbl->GetAdapterModeCount(p,a,b)
92 #define IWineD3D_EnumAdapterModes(p,a,b,c,d) (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d)
93 #define IWineD3D_GetAdapterDisplayMode(p,a,b) (p)->lpVtbl->GetAdapterDisplayMode(p,a,b)
94 #define IWineD3D_GetAdapterIdentifier(p,a,b,c) (p)->lpVtbl->GetAdapterIdentifier(p,a,b,c)
95 #define IWineD3D_CheckDeviceMultiSampleType(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f)
96 #define IWineD3D_CheckDepthStencilMatch(p,a,b,c,d,e) (p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e)
97 #define IWineD3D_CheckDeviceType(p,a,b,c,d,e) (p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e)
98 #define IWineD3D_CheckDeviceFormat(p,a,b,c,d,e,f) (p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f)
99 #define IWineD3D_CheckDeviceFormatConversion(p,a,b,c,d) (p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d)
102 /* Define the main WineD3D entrypoint */
103 IWineD3D* WINAPI WineDirect3DCreate(UINT SDKVersion, UINT dxVersion);
108 #if 0 /* FIXME: During porting in from d3d8 - the following will be used */
109 /*****************************************************************
114 #define MAX_PALETTES 256
115 #define MAX_STREAMS 16
116 #define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
117 #define MAX_LEVELS 256
119 /* Other useful values */
120 #define HIGHEST_RENDER_STATE 174
121 #define HIGHEST_TEXTURE_STATE 29
122 #define HIGHEST_TRANSFORMSTATE 512
123 #define D3DSBT_RECORDED 0xfffffffe
125 #define D3D_VSHADER_MAX_CONSTANTS 96
126 #define D3D_PSHADER_MAX_CONSTANTS 32
128 /*****************************************************************
132 #include "wine/wined3d_gl.h"
133 #include "wine/wined3d_types.h"
139 /*****************************************************************
143 typedef struct IDirect3DImpl IDirect3DImpl;
144 typedef struct IDirect3DBaseTextureImpl IDirect3DBaseTextureImpl;
145 typedef struct IDirect3DVolumeTextureImpl IDirect3DVolumeTextureImpl;
146 typedef struct IDirect3DDeviceImpl IDirect3DDeviceImpl;
147 typedef struct IDirect3DTextureImpl IDirect3DTextureImpl;
148 typedef struct IDirect3DCubeTextureImpl IDirect3DCubeTextureImpl;
149 typedef struct IDirect3DIndexBufferImpl IDirect3DIndexBufferImpl;
150 typedef struct IDirect3DSurfaceImpl IDirect3DSurfaceImpl;
151 typedef struct IDirect3DSwapChainImpl IDirect3DSwapChainImpl;
152 typedef struct IDirect3DResourceImpl IDirect3DResourceImpl;
153 typedef struct IDirect3DVolumeImpl IDirect3DVolumeImpl;
154 typedef struct IDirect3DVertexBufferImpl IDirect3DVertexBufferImpl;
155 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
156 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
157 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
158 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
161 /*************************************************************
162 * d3dcore interfaces defs
165 /** Vertex Shader API */
166 extern HRESULT WINAPI IDirect3DVertexShaderImpl_ParseProgram(IDirect3DVertexShaderImpl* This, CONST DWORD* pFunction);
167 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetFunction(IDirect3DVertexShaderImpl* This, VOID* pData, UINT* pSizeOfData);
168 extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount);
169 extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST INT* pConstantData, UINT Vector4iCount);
170 extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount);
171 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, BOOL* pConstantData, UINT BoolCount);
172 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, INT* pConstantData, UINT Vector4iCount);
173 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, FLOAT* pConstantData, UINT Vector4fCount);
174 /* internal Interfaces */
175 extern DWORD WINAPI IDirect3DVertexShaderImpl_GetVersion(IDirect3DVertexShaderImpl* This);
176 extern HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* This, VSHADERINPUTDATA* input, VSHADEROUTPUTDATA* output);
178 #endif /* Temporary #if 0 */