RetroArch
d3dx9xof.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (C) Microsoft Corporation. All Rights Reserved.
4  *
5  * File: d3dx9xof.h
6  * Content: D3DX .X File types and functions
7  *
8  */
9 
10 #include "d3dx9.h"
11 
12 #if !defined( __D3DX9XOF_H__ )
13 #define __D3DX9XOF_H__
14 
15 #if defined( __cplusplus )
16 extern "C" {
17 #endif /* defined( __cplusplus ) */
18 
19 typedef DWORD D3DXF_FILEFORMAT;
20 
21 #define D3DXF_FILEFORMAT_BINARY 0
22 #define D3DXF_FILEFORMAT_TEXT 1
23 #define D3DXF_FILEFORMAT_COMPRESSED 2
24 
25 typedef DWORD D3DXF_FILESAVEOPTIONS;
26 
27 #define D3DXF_FILESAVE_TOFILE 0x00L
28 #define D3DXF_FILESAVE_TOWFILE 0x01L
29 
30 typedef DWORD D3DXF_FILELOADOPTIONS;
31 
32 #define D3DXF_FILELOAD_FROMFILE 0x00L
33 #define D3DXF_FILELOAD_FROMWFILE 0x01L
34 #define D3DXF_FILELOAD_FROMRESOURCE 0x02L
35 #define D3DXF_FILELOAD_FROMMEMORY 0x03L
36 
37 /*
38  * D3DXF_FILELOADRESOURCE:
39 */
40 
42 {
43  HMODULE hModule; /* Desc */
44  LPCSTR lpName; /* Desc */
45  LPCSTR lpType; /* Desc */
47 
48 /*
49  * D3DXF_FILELOADMEMORY:
50  */
51 
52 typedef struct _D3DXF_FILELOADMEMORY
53 {
54  LPCVOID lpMemory; /* Desc */
55  SIZE_T dSize; /* Desc */
57 
58 #if defined( _WIN32 ) && !defined( _NO_COM )
59 
60 /* {cef08cf9-7b4f-4429-9624-2a690a933201} */
61 DEFINE_GUID( IID_ID3DXFile,
62 0xcef08cf9, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
63 
64 /* {cef08cfa-7b4f-4429-9624-2a690a933201} */
65 DEFINE_GUID( IID_ID3DXFileSaveObject,
66 0xcef08cfa, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
67 
68 /* {cef08cfb-7b4f-4429-9624-2a690a933201} */
69 DEFINE_GUID( IID_ID3DXFileSaveData,
70 0xcef08cfb, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
71 
72 /* {cef08cfc-7b4f-4429-9624-2a690a933201} */
73 DEFINE_GUID( IID_ID3DXFileEnumObject,
74 0xcef08cfc, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
75 
76 /* {cef08cfd-7b4f-4429-9624-2a690a933201} */
77 DEFINE_GUID( IID_ID3DXFileData,
78 0xcef08cfd, 0x7b4f, 0x4429, 0x96, 0x24, 0x2a, 0x69, 0x0a, 0x93, 0x32, 0x01 );
79 
80 #endif /* defined( _WIN32 ) && !defined( _NO_COM ) */
81 
82 #if defined( __cplusplus )
83 #if !defined( DECLSPEC_UUID )
84 #if _MSC_VER >= 1100
85 #define DECLSPEC_UUID( x ) __declspec( uuid( x ) )
86 #else /* !( _MSC_VER >= 1100 ) */
87 #define DECLSPEC_UUID( x )
88 #endif /* !( _MSC_VER >= 1100 ) */
89 #endif /* !defined( DECLSPEC_UUID ) */
90 
91 interface DECLSPEC_UUID( "cef08cf9-7b4f-4429-9624-2a690a933201" )
92  ID3DXFile;
93 interface DECLSPEC_UUID( "cef08cfa-7b4f-4429-9624-2a690a933201" )
95 interface DECLSPEC_UUID( "cef08cfb-7b4f-4429-9624-2a690a933201" )
97 interface DECLSPEC_UUID( "cef08cfc-7b4f-4429-9624-2a690a933201" )
99 interface DECLSPEC_UUID( "cef08cfd-7b4f-4429-9624-2a690a933201" )
101 
102 #if defined( _COM_SMARTPTR_TYPEDEF )
103 _COM_SMARTPTR_TYPEDEF( ID3DXFile,
104  __uuidof( ID3DXFile ) );
105 _COM_SMARTPTR_TYPEDEF( ID3DXFileSaveObject,
106  __uuidof( ID3DXFileSaveObject ) );
107 _COM_SMARTPTR_TYPEDEF( ID3DXFileSaveData,
108  __uuidof( ID3DXFileSaveData ) );
109 _COM_SMARTPTR_TYPEDEF( ID3DXFileEnumObject,
110  __uuidof( ID3DXFileEnumObject ) );
111 _COM_SMARTPTR_TYPEDEF( ID3DXFileData,
112  __uuidof( ID3DXFileData ) );
113 #endif /* defined( _COM_SMARTPTR_TYPEDEF ) */
114 #endif /* defined( __cplusplus ) */
115 
116 typedef interface ID3DXFile ID3DXFile;
120 typedef interface ID3DXFileData ID3DXFileData;
121 
122 /*
123  * ID3DXFile
124  */
125 
126 #undef INTERFACE
127 #define INTERFACE ID3DXFile
128 
130 {
131  STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
132  STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
133  STDMETHOD_( ULONG, Release )( THIS ) PURE;
134 
135  STDMETHOD( CreateEnumObject )( THIS_ LPCVOID, D3DXF_FILELOADOPTIONS,
136  ID3DXFileEnumObject** ) PURE;
137  STDMETHOD( CreateSaveObject )( THIS_ LPCVOID, D3DXF_FILESAVEOPTIONS,
139  STDMETHOD( RegisterTemplates )( THIS_ LPCVOID, SIZE_T ) PURE;
140  STDMETHOD( RegisterEnumTemplates )( THIS_ ID3DXFileEnumObject* ) PURE;
141 };
142 
143 /*
144  * ID3DXFileSaveObject
145  */
146 
147 #undef INTERFACE
148 #define INTERFACE ID3DXFileSaveObject
149 
151 {
152  STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
153  STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
154  STDMETHOD_( ULONG, Release )( THIS ) PURE;
155 
156  STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE;
157  STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*,
158  SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE;
159  STDMETHOD( Save )( THIS ) PURE;
160 };
161 
162 /*
163  * ID3DXFileSaveData
164  */
165 
166 #undef INTERFACE
167 #define INTERFACE ID3DXFileSaveData
168 
170 {
171  STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
172  STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
173  STDMETHOD_( ULONG, Release )( THIS ) PURE;
174 
175  STDMETHOD( GetSave )( THIS_ ID3DXFileSaveObject** ) PURE;
176  STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE;
177  STDMETHOD( GetId )( THIS_ LPGUID ) PURE;
178  STDMETHOD( GetType )( THIS_ GUID* ) PURE;
179  STDMETHOD( AddDataObject )( THIS_ REFGUID, LPCSTR, CONST GUID*,
180  SIZE_T, LPCVOID, ID3DXFileSaveData** ) PURE;
181  STDMETHOD( AddDataReference )( THIS_ LPCSTR, CONST GUID* ) PURE;
182 };
183 
184 /*
185  * ID3DXFileEnumObject
186  */
187 
188 #undef INTERFACE
189 #define INTERFACE ID3DXFileEnumObject
190 
192 {
193  STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
194  STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
195  STDMETHOD_( ULONG, Release )( THIS ) PURE;
196 
197  STDMETHOD( GetFile )( THIS_ ID3DXFile** ) PURE;
198  STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE;
199  STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE;
200  STDMETHOD( GetDataObjectById )( THIS_ REFGUID, ID3DXFileData** ) PURE;
201  STDMETHOD( GetDataObjectByName )( THIS_ LPCSTR, ID3DXFileData** ) PURE;
202 };
203 
204 /*
205  * ID3DXFileData
206  */
207 
208 #undef INTERFACE
209 #define INTERFACE ID3DXFileData
210 
212 {
213  STDMETHOD( QueryInterface )( THIS_ REFIID, LPVOID* ) PURE;
214  STDMETHOD_( ULONG, AddRef )( THIS ) PURE;
215  STDMETHOD_( ULONG, Release )( THIS ) PURE;
216 
217  STDMETHOD( GetEnum )( THIS_ ID3DXFileEnumObject** ) PURE;
218  STDMETHOD( GetName )( THIS_ LPSTR, SIZE_T* ) PURE;
219  STDMETHOD( GetId )( THIS_ LPGUID ) PURE;
220  STDMETHOD( Lock )( THIS_ SIZE_T*, LPCVOID* ) PURE;
221  STDMETHOD( Unlock )( THIS ) PURE;
222  STDMETHOD( GetType )( THIS_ GUID* ) PURE;
223  STDMETHOD_( BOOL, IsReference )( THIS ) PURE;
224  STDMETHOD( GetChildren )( THIS_ SIZE_T* ) PURE;
225  STDMETHOD( GetChild )( THIS_ SIZE_T, ID3DXFileData** ) PURE;
226 };
227 
228 STDAPI D3DXFileCreate( ID3DXFile** lplpDirectXFile );
229 
230 /*
231  * DirectX File errors.
232  */
233 
234 #define _FACD3DXF 0x876
235 
236 #define D3DXFERR_BADOBJECT MAKE_HRESULT( 1, _FACD3DXF, 900 )
237 #define D3DXFERR_BADVALUE MAKE_HRESULT( 1, _FACD3DXF, 901 )
238 #define D3DXFERR_BADTYPE MAKE_HRESULT( 1, _FACD3DXF, 902 )
239 #define D3DXFERR_NOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 903 )
240 #define D3DXFERR_NOTDONEYET MAKE_HRESULT( 1, _FACD3DXF, 904 )
241 #define D3DXFERR_FILENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 905 )
242 #define D3DXFERR_RESOURCENOTFOUND MAKE_HRESULT( 1, _FACD3DXF, 906 )
243 #define D3DXFERR_BADRESOURCE MAKE_HRESULT( 1, _FACD3DXF, 907 )
244 #define D3DXFERR_BADFILETYPE MAKE_HRESULT( 1, _FACD3DXF, 908 )
245 #define D3DXFERR_BADFILEVERSION MAKE_HRESULT( 1, _FACD3DXF, 909 )
246 #define D3DXFERR_BADFILEFLOATSIZE MAKE_HRESULT( 1, _FACD3DXF, 910 )
247 #define D3DXFERR_BADFILE MAKE_HRESULT( 1, _FACD3DXF, 911 )
248 #define D3DXFERR_PARSEERROR MAKE_HRESULT( 1, _FACD3DXF, 912 )
249 #define D3DXFERR_BADARRAYSIZE MAKE_HRESULT( 1, _FACD3DXF, 913 )
250 #define D3DXFERR_BADDATAREFERENCE MAKE_HRESULT( 1, _FACD3DXF, 914 )
251 #define D3DXFERR_NOMOREOBJECTS MAKE_HRESULT( 1, _FACD3DXF, 915 )
252 #define D3DXFERR_NOMOREDATA MAKE_HRESULT( 1, _FACD3DXF, 916 )
253 #define D3DXFERR_BADCACHEFILE MAKE_HRESULT( 1, _FACD3DXF, 917 )
254 
255 /*
256  * DirectX File object types.
257  */
258 
259 #ifndef WIN_TYPES
260 #define WIN_TYPES(itype, ptype) typedef interface itype *LP##ptype, **LPLP##ptype
261 #endif
262 
263 WIN_TYPES(ID3DXFile, D3DXFILE);
264 WIN_TYPES(ID3DXFileEnumObject, D3DXFILEENUMOBJECT);
265 WIN_TYPES(ID3DXFileSaveObject, D3DXFILESAVEOBJECT);
266 WIN_TYPES(ID3DXFileData, D3DXFILEDATA);
267 WIN_TYPES(ID3DXFileSaveData, D3DXFILESAVEDATA);
268 
269 #if defined( __cplusplus )
270 } /* extern "C" */
271 #endif /* defined( __cplusplus ) */
272 
273 #endif /* !defined( __D3DX9XOF_H__ ) */
Definition: d3dx9xof.h:41
interface ID3DXFileData ID3DXFileData
Definition: d3dx9xof.h:120
DWORD D3DXF_FILEFORMAT
Definition: d3dx9xof.h:19
interface ID3DXFileSaveData ID3DXFileSaveData
Definition: d3dx9xof.h:118
HMODULE hModule
Definition: d3dx9xof.h:43
WIN_TYPES(ID3DXFile, D3DXFILE)
DEFINE_GUID(IID_ID3DXBuffer, 0x932e6a7e, 0xc68e, 0x45dd, 0xa7, 0xbf, 0x53, 0xd1, 0x9c, 0x86, 0xdb, 0x1f)
DECLARE_INTERFACE_(ID3DXFile, IUnknown)
Definition: d3dx9xof.h:129
interface DECLSPEC_UUID("C530AD7D-9B16-4395-A979-BA2ECFF83ADD") ID3D10ShaderReflectionType
STDAPI D3DXFileCreate(ID3DXFile **lplpDirectXFile)
DWORD D3DXF_FILESAVEOPTIONS
Definition: d3dx9xof.h:25
SIZE_T dSize
Definition: d3dx9xof.h:55
struct _D3DXF_FILELOADRESOURCE D3DXF_FILELOADRESOURCE
LPCSTR lpName
Definition: d3dx9xof.h:44
static INLINE ULONG Release(void *object)
Definition: dxgi_common.h:253
unsigned int BOOL
Definition: gctypes.h:51
interface ID3DXFileSaveObject ID3DXFileSaveObject
Definition: d3dx9xof.h:117
interface ID3DXFileEnumObject ID3DXFileEnumObject
Definition: d3dx9xof.h:119
Definition: d3dx9xof.h:52
LPCVOID lpMemory
Definition: d3dx9xof.h:54
Definition: glslang_tab.cpp:133
DWORD D3DXF_FILELOADOPTIONS
Definition: d3dx9xof.h:30
LPCSTR lpType
Definition: d3dx9xof.h:45
interface ID3DXFile ID3DXFile
Definition: d3dx9xof.h:116
struct _D3DXF_FILELOADMEMORY D3DXF_FILELOADMEMORY