Move the Check* type functions into wined3d and copy from d3d9, and
[wine] / include / wine / wined3d_interface.h
1 /*
2  * Direct3D wine internal public interface file
3  *
4  * Copyright 2002-2003 The wine-d3d team
5  * Copyright 2002-2003 Raphael Junqueira
6  *
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.
11  *
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.
16  *
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
20  */
21
22 #ifndef __WINE_WINED3D_INTERFACE_H
23 #define __WINE_WINED3D_INTERFACE_H
24
25 #if !defined( __WINE_CONFIG_H )
26 # error You must include config.h to use this header
27 #endif
28
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
31 #endif
32
33 /*****************************************************************
34  * THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES 
35  * PLEASE USE wine/wined3d_gl.h INSTEAD
36  */
37
38
39 /*****************************************************************************
40  * WineD3D Structures 
41  */
42
43 typedef struct _WINED3DADAPTER_IDENTIFIER {
44     char           *Driver;
45     char           *Description;
46     char           *DeviceName;
47     LARGE_INTEGER  *DriverVersion; 
48     DWORD          *VendorId;
49     DWORD          *DeviceId;
50     DWORD          *SubSysId;
51     DWORD          *Revision;
52     GUID           *DeviceIdentifier;
53     DWORD          *WHQLLevel;
54 } WINED3DADAPTER_IDENTIFIER;
55
56
57
58 /*****************************************************************************
59  * WineD3D interface 
60  */
61 typedef struct IWineD3D IWineD3D;
62
63 #define INTERFACE IWineD3D
64 #define IWineD3D_METHODS \
65     IUnknown_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; \
78
79 DECLARE_INTERFACE_(IWineD3D,IUnknown) { IWineD3D_METHODS };
80 #undef INTERFACE
81
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)
100 #endif
101
102 /* Define the main WineD3D entrypoint */
103 IWineD3D* WINAPI WineDirect3DCreate(UINT SDKVersion, UINT dxVersion);
104
105
106
107
108 #if 0 /* FIXME: During porting in from d3d8 - the following will be used */
109 /*****************************************************************
110  * Some defines
111  */
112
113 /* Device caps */
114 #define MAX_PALETTES      256
115 #define MAX_STREAMS       16
116 #define MAX_CLIPPLANES    D3DMAXUSERCLIPPLANES
117 #define MAX_LEVELS        256
118
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
124
125 #define D3D_VSHADER_MAX_CONSTANTS 96
126 #define D3D_PSHADER_MAX_CONSTANTS 32
127
128 /*****************************************************************
129  * Some includes
130  */
131
132 #include "wine/wined3d_gl.h"
133 #include "wine/wined3d_types.h"
134
135 #include <stdarg.h>
136 #include <windef.h>
137 #include <winbase.h>
138
139 /*****************************************************************
140  * Some defines
141  */
142
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;
159
160
161 /*************************************************************
162  * d3dcore interfaces defs
163  */
164
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);
177
178 #endif /* Temporary #if 0 */
179
180
181 #endif