- DeviceCapabilities16 now calls PSDRV_DeviceCapabilities.
[wine] / include / d3dx8core.h
1 /*
2  * Copyright (C) 2002 Raphael Junqueira
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef __WINE_D3DX8CORE_H
20 #define __WINE_D3DX8CORE_H
21
22 #include "objbase.h"
23
24 #include "d3d8.h"
25 #include "d3d8types.h"
26 #include "d3d8caps.h"
27
28 /*****************************************************************************
29  * #defines and error codes
30  */
31 #define D3DXASM_DEBUG           1
32 #define D3DXASM_SKIPVALIDATION  2
33
34 #define _FACD3D  0x876
35 #define MAKE_D3DXHRESULT( code )  MAKE_HRESULT( 1, _FACD3D, code )
36
37 /*
38  * Direct3D Errors
39  */
40 #define D3DXERR_CANNOTATTRSORT                  MAKE_D3DXHRESULT(2158)
41 #define D3DXERR_CANNOTMODIFYINDEXBUFFER         MAKE_D3DXHRESULT(2159)
42 #define D3DXERR_INVALIDMESH                     MAKE_D3DXHRESULT(2160)
43 #define D3DXERR_SKINNINGNOTSUPPORTED            MAKE_D3DXHRESULT(2161)
44 #define D3DXERR_TOOMANYINFLUENCES               MAKE_D3DXHRESULT(2162)
45 #define D3DXERR_INVALIDDATA                     MAKE_D3DXHRESULT(2163)
46
47 /*****************************************************************************
48  * Predeclare the interfaces
49  */
50 DEFINE_GUID(IID_ID3DXBuffer,             0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x12);/* FIXME */
51 typedef struct ID3DXBuffer              ID3DXBuffer, *LPD3DXBUFFER;
52 DEFINE_GUID(IID_ID3DXFont,               0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x13);/* FIXME */
53 typedef struct ID3DXFont                ID3DXFont, *LPD3DXFONT;
54
55 /*****************************************************************************
56  * ID3DXBuffer interface
57  */
58 #undef ICOM_INTERFACE
59 #define ICOM_INTERFACE ID3DXBuffer
60 #define ID3DXBuffer_METHODS \
61     /*** ID3DXBuffer methods ***/ \
62     ICOM_METHOD (LPVOID,  GetBufferPointer) \
63     ICOM_METHOD (DWORD,   GetBufferSize)
64
65     /*** ID3DXBuffer methods ***/
66 #define ID3DXBuffer_IMETHODS \
67     IUnknown_IMETHODS \
68     ID3DXBuffer_METHODS
69 ICOM_DEFINE(ID3DXBuffer,IUnknown)
70 #undef ICOM_INTERFACE
71
72 /*** IUnknown methods ***/
73 #define ID3DXBuffer_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
74 #define ID3DXBuffer_AddRef(p)             ICOM_CALL (AddRef,p)
75 #define ID3DXBuffer_Release(p)            ICOM_CALL (Release,p)
76 /*** ID3DXBuffer methods ***/
77 #define ID3DXBuffer_GetBufferPointer(p)   ICOM_CALL (GetBufferPointer,p)
78 #define ID3DXBuffer_GetBufferSize(p)      ICOM_CALL (GetBufferSize,p)
79
80 /*****************************************************************************
81  * ID3DXFont interface
82  */
83 #undef ICOM_INTERFACE
84 #define ICOM_INTERFACE ID3DXFont
85 #define ID3DXFont_METHODS \
86     /*** ID3DXFont methods ***/ \
87     ICOM_METHOD (HRESULT,  Begin) \
88     ICOM_METHOD (HRESULT,  DrawTextA) \
89     ICOM_METHOD (HRESULT,  End)
90
91     /*** ID3DXFont methods ***/
92 #define ID3DXFont_IMETHODS \
93     IUnknown_IMETHODS \
94     ID3DXFont_METHODS
95 ICOM_DEFINE(ID3DXFont,IUnknown)
96 #undef ICOM_INTERFACE
97
98 /*** IUnknown methods ***/
99 #define ID3DXFont_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
100 #define ID3DXFont_AddRef(p)             ICOM_CALL (AddRef,p)
101 #define ID3DXFont_Release(p)            ICOM_CALL (Release,p)
102 /*** ID3DXFont methods ***/
103 #define ID3DXFont_Begin(p)              ICOM_CALL (Begin,p)
104 #define ID3DXFont_DrawTextA(p,a,b,c,d,e)ICOM_CALL5(DrawText,p,a,b,c,d,e)
105 #define ID3DXFont_End(p)                ICOM_CALL (End,p)
106
107 /*************************************************************************************
108  * Define entrypoints 
109  */
110 HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer);
111 HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont);
112 UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF);
113 HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, 
114                            LPD3DXBUFFER* ppConstants, 
115                            LPD3DXBUFFER* ppCompiledShader,
116                            LPD3DXBUFFER* ppCompilationErrors);
117 HRESULT WINAPI D3DXAssembleShaderFromFileA(LPSTR pSrcFile, DWORD Flags,
118                                     LPD3DXBUFFER* ppConstants,
119                                     LPD3DXBUFFER* ppCompiledShader,
120                                     LPD3DXBUFFER* ppCompilationErrors);
121 HRESULT WINAPI D3DXAssembleShaderFromFileW(LPSTR pSrcFile, DWORD Flags,
122                                     LPD3DXBUFFER* ppConstants,
123                                     LPD3DXBUFFER* ppCompiledShader,
124                                     LPD3DXBUFFER* ppCompilationErrors);
125
126 #endif /* __WINE_D3DX8CORE_H */