- Make d3d8 know about the wined3d device and start using it.
[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 interface 
41  */
42 typedef struct IWineD3D IWineD3D;
43
44 #define INTERFACE IWineD3D
45 #define IWineD3D_METHODS \
46     IUnknown_METHODS \
47     STDMETHOD_(UINT,GetAdapterCount             )(THIS) PURE; \
48     STDMETHOD(RegisterSoftwareDevice)(THIS_ void * pInitializeFunction) PURE; \
49     STDMETHOD_(HMONITOR,GetAdapterMonitor)(THIS_ UINT Adapter) PURE; \
50     STDMETHOD_(UINT,GetAdapterModeCount)(THIS_ UINT Adapter, D3DFORMAT Format) PURE; \
51     STDMETHOD(EnumAdapterModes)(THIS_ UINT  Adapter, UINT  Mode, D3DFORMAT Format, D3DDISPLAYMODE * pMode) PURE; \
52     STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT  Adapter, D3DDISPLAYMODE * pMode) PURE; \
53     
54
55 DECLARE_INTERFACE_(IWineD3D,IUnknown) { IWineD3D_METHODS };
56 #undef INTERFACE
57
58 #ifdef COBJMACROS
59 /*** IUnknown methods ***/
60 #define IWineD3D_QueryInterface(p,a,b)                    (p)->lpVtbl->QueryInterface(p,a,b)
61 #define IWineD3D_AddRef(p)                                (p)->lpVtbl->AddRef(p)
62 #define IWineD3D_Release(p)                               (p)->lpVtbl->Release(p)
63 /*** IWineD3D methods ***/
64 #define IWineD3D_GetAdapterCount(p)                       (p)->lpVtbl->GetAdapterCount(p)
65 #define IWineD3D_RegisterSoftwareDevice(p,a)              (p)->lpVtbl->RegisterSoftwareDevice(p,a)
66 #define IWineD3D_GetAdapterMonitor(p,a)                   (p)->lpVtbl->GetAdapterMonitor(p,a)
67 #define IWineD3D_GetAdapterModeCount(p,a,b)               (p)->lpVtbl->GetAdapterModeCount(p,a,b)
68 #define IWineD3D_EnumAdapterModes(p,a,b,c,d)              (p)->lpVtbl->EnumAdapterModes(p,a,b,c,d)
69 #define IWineD3D_GetAdapterDisplayMode(p,a,b)             (p)->lpVtbl->GetAdapterDisplayMode(p,a,b)
70
71 #endif
72
73 /* Define the main WineD3D entrypoint */
74 IWineD3D* WINAPI WineDirect3DCreate(UINT SDKVersion, UINT dxVersion);
75
76
77
78
79 #if 0 /* FIXME: During porting in from d3d8 - the following will be used */
80 /*****************************************************************
81  * Some defines
82  */
83
84 /* Device caps */
85 #define MAX_PALETTES      256
86 #define MAX_STREAMS       16
87 #define MAX_CLIPPLANES    D3DMAXUSERCLIPPLANES
88 #define MAX_LEVELS        256
89
90 /* Other useful values */
91 #define HIGHEST_RENDER_STATE 174
92 #define HIGHEST_TEXTURE_STATE 29
93 #define HIGHEST_TRANSFORMSTATE 512
94 #define D3DSBT_RECORDED 0xfffffffe
95
96 #define D3D_VSHADER_MAX_CONSTANTS 96
97 #define D3D_PSHADER_MAX_CONSTANTS 32
98
99 /*****************************************************************
100  * Some includes
101  */
102
103 #include "wine/wined3d_gl.h"
104 #include "wine/wined3d_types.h"
105
106 #include <stdarg.h>
107 #include <windef.h>
108 #include <winbase.h>
109
110 /*****************************************************************
111  * Some defines
112  */
113
114 typedef struct IDirect3DImpl IDirect3DImpl;
115 typedef struct IDirect3DBaseTextureImpl IDirect3DBaseTextureImpl;
116 typedef struct IDirect3DVolumeTextureImpl IDirect3DVolumeTextureImpl;
117 typedef struct IDirect3DDeviceImpl IDirect3DDeviceImpl;
118 typedef struct IDirect3DTextureImpl IDirect3DTextureImpl;
119 typedef struct IDirect3DCubeTextureImpl IDirect3DCubeTextureImpl;
120 typedef struct IDirect3DIndexBufferImpl IDirect3DIndexBufferImpl;
121 typedef struct IDirect3DSurfaceImpl IDirect3DSurfaceImpl;
122 typedef struct IDirect3DSwapChainImpl IDirect3DSwapChainImpl;
123 typedef struct IDirect3DResourceImpl IDirect3DResourceImpl;
124 typedef struct IDirect3DVolumeImpl IDirect3DVolumeImpl;
125 typedef struct IDirect3DVertexBufferImpl IDirect3DVertexBufferImpl;
126 typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
127 typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
128 typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
129 typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclarationImpl;
130
131
132 /*************************************************************
133  * d3dcore interfaces defs
134  */
135
136 /** Vertex Shader API */
137 extern HRESULT WINAPI IDirect3DVertexShaderImpl_ParseProgram(IDirect3DVertexShaderImpl* This, CONST DWORD* pFunction);
138 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetFunction(IDirect3DVertexShaderImpl* This, VOID* pData, UINT* pSizeOfData);
139 extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST BOOL*  pConstantData, UINT BoolCount);
140 extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST INT*   pConstantData, UINT Vector4iCount);
141 extern HRESULT WINAPI IDirect3DVertexShaderImpl_SetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, CONST FLOAT* pConstantData, UINT Vector4fCount);
142 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantB(IDirect3DVertexShaderImpl* This, UINT StartRegister, BOOL*  pConstantData, UINT BoolCount);
143 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantI(IDirect3DVertexShaderImpl* This, UINT StartRegister, INT*   pConstantData, UINT Vector4iCount);
144 extern HRESULT WINAPI IDirect3DVertexShaderImpl_GetConstantF(IDirect3DVertexShaderImpl* This, UINT StartRegister, FLOAT* pConstantData, UINT Vector4fCount);
145 /* internal Interfaces */
146 extern DWORD   WINAPI IDirect3DVertexShaderImpl_GetVersion(IDirect3DVertexShaderImpl* This);
147 extern HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* This, VSHADERINPUTDATA* input, VSHADEROUTPUTDATA* output);
148
149 #endif /* Temporary #if 0 */
150
151
152 #endif