RetroArch
d3dx10core.h
Go to the documentation of this file.
1 //
3 // Copyright (C) Microsoft Corporation. All Rights Reserved.
4 //
5 // File: d3dx10core.h
6 // Content: D3DX10 core types and functions
7 //
9 
10 #include "d3dx10.h"
11 
12 #ifndef __D3DX10CORE_H__
13 #define __D3DX10CORE_H__
14 
15 // Current name of the DLL shipped in the same SDK as this header.
16 
17 
18 #define D3DX10_DLL_W L"d3dx10_43.dll"
19 #define D3DX10_DLL_A "d3dx10_43.dll"
20 
21 #ifdef UNICODE
22  #define D3DX10_DLL D3DX10_DLL_W
23 #else
24  #define D3DX10_DLL D3DX10_DLL_A
25 #endif
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif //__cplusplus
30 
32 // D3DX10_SDK_VERSION:
33 // -----------------
34 // This identifier is passed to D3DX10CheckVersion in order to ensure that an
35 // application was built against the correct header files and lib files.
36 // This number is incremented whenever a header (or other) change would
37 // require applications to be rebuilt. If the version doesn't match,
38 // D3DX10CreateVersion will return FALSE. (The number itself has no meaning.)
40 
41 
42 #define D3DX10_SDK_VERSION 43
43 
44 
46 // D3DX10CreateDevice
47 // D3DX10CreateDeviceAndSwapChain
48 // D3DX10GetFeatureLevel1
50 HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *pAdapter,
51  D3D10_DRIVER_TYPE DriverType,
52  HMODULE Software,
53  UINT Flags,
54  ID3D10Device **ppDevice);
55 
57  D3D10_DRIVER_TYPE DriverType,
58  HMODULE Software,
59  UINT Flags,
60  DXGI_SWAP_CHAIN_DESC *pSwapChainDesc,
61  IDXGISwapChain **ppSwapChain,
62  ID3D10Device **ppDevice);
63 
64 typedef interface ID3D10Device1 ID3D10Device1;
65 HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *pDevice, ID3D10Device1 **ppDevice1);
66 
67 
68 #ifdef D3D_DIAG_DLL
69 BOOL WINAPI D3DX10DebugMute(BOOL Mute);
70 #endif
71 HRESULT WINAPI D3DX10CheckVersion(UINT D3DSdkVersion, UINT D3DX10SdkVersion);
72 
73 #ifdef __cplusplus
74 }
75 #endif //__cplusplus
76 
77 
79 // D3DX10_SPRITE flags:
80 // -----------------
81 // D3DX10_SPRITE_SAVE_STATE
82 // Specifies device state should be saved and restored in Begin/End.
83 // D3DX10SPRITE_SORT_TEXTURE
84 // Sprites are sorted by texture prior to drawing. This is recommended when
85 // drawing non-overlapping sprites of uniform depth. For example, drawing
86 // screen-aligned text with ID3DX10Font.
87 // D3DX10SPRITE_SORT_DEPTH_FRONT_TO_BACK
88 // Sprites are sorted by depth front-to-back prior to drawing. This is
89 // recommended when drawing opaque sprites of varying depths.
90 // D3DX10SPRITE_SORT_DEPTH_BACK_TO_FRONT
91 // Sprites are sorted by depth back-to-front prior to drawing. This is
92 // recommended when drawing transparent sprites of varying depths.
93 // D3DX10SPRITE_ADDREF_TEXTURES
94 // AddRef/Release all textures passed in to DrawSpritesBuffered
96 
97 typedef enum _D3DX10_SPRITE_FLAG
98 {
105 
106 typedef struct _D3DX10_SPRITE
107 {
109 
112 
114 
117 } D3DX10_SPRITE;
118 
119 
121 // ID3DX10Sprite:
122 // ------------
123 // This object intends to provide an easy way to drawing sprites using D3D.
124 //
125 // Begin -
126 // Prepares device for drawing sprites.
127 //
128 // Draw -
129 // Draws a sprite
130 //
131 // Flush -
132 // Forces all batched sprites to submitted to the device.
133 //
134 // End -
135 // Restores device state to how it was when Begin was called.
136 //
138 
139 typedef interface ID3DX10Sprite ID3DX10Sprite;
140 typedef interface ID3DX10Sprite *LPD3DX10SPRITE;
141 
142 
143 // {BA0B762D-8D28-43ec-B9DC-2F84443B0614}
144 DEFINE_GUID(IID_ID3DX10Sprite,
145 0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14);
146 
147 
148 #undef INTERFACE
149 #define INTERFACE ID3DX10Sprite
150 
152 {
153  // IUnknown
154  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
155  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
156  STDMETHOD_(ULONG, Release)(THIS) PURE;
157 
158  // ID3DX10Sprite
159  STDMETHOD(Begin)(THIS_ UINT flags) PURE;
160 
161  STDMETHOD(DrawSpritesBuffered)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites) PURE;
162  STDMETHOD(Flush)(THIS) PURE;
163 
164  STDMETHOD(DrawSpritesImmediate)(THIS_ D3DX10_SPRITE *pSprites, UINT cSprites, UINT cbSprite, UINT flags) PURE;
165  STDMETHOD(End)(THIS) PURE;
166 
167  STDMETHOD(GetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE;
168  STDMETHOD(SetViewTransform)(THIS_ D3DXMATRIX *pViewTransform) PURE;
169  STDMETHOD(GetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE;
170  STDMETHOD(SetProjectionTransform)(THIS_ D3DXMATRIX *pProjectionTransform) PURE;
171 
172  STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
173 };
174 
175 
176 #ifdef __cplusplus
177 extern "C" {
178 #endif //__cplusplus
179 
180 HRESULT WINAPI
182  ID3D10Device* pDevice,
183  UINT cDeviceBufferSize,
184  LPD3DX10SPRITE* ppSprite);
185 
186 #ifdef __cplusplus
187 }
188 #endif //__cplusplus
189 
190 
192 // ID3DX10ThreadPump:
194 
195 #undef INTERFACE
196 #define INTERFACE ID3DX10DataLoader
197 
198 DECLARE_INTERFACE(ID3DX10DataLoader)
199 {
200  STDMETHOD(Load)(THIS) PURE;
201  STDMETHOD(Decompress)(THIS_ void **ppData, SIZE_T *pcBytes) PURE;
202  STDMETHOD(Destroy)(THIS) PURE;
203 };
204 
205 #undef INTERFACE
206 #define INTERFACE ID3DX10DataProcessor
207 
208 DECLARE_INTERFACE(ID3DX10DataProcessor)
209 {
210  STDMETHOD(Process)(THIS_ void *pData, SIZE_T cBytes) PURE;
211  STDMETHOD(CreateDeviceObject)(THIS_ void **ppDataObject) PURE;
212  STDMETHOD(Destroy)(THIS) PURE;
213 };
214 
215 // {C93FECFA-6967-478a-ABBC-402D90621FCB}
216 DEFINE_GUID(IID_ID3DX10ThreadPump,
217 0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb);
218 
219 #undef INTERFACE
220 #define INTERFACE ID3DX10ThreadPump
221 
222 DECLARE_INTERFACE_(ID3DX10ThreadPump, IUnknown)
223 {
224  // IUnknown
225  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
226  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
227  STDMETHOD_(ULONG, Release)(THIS) PURE;
228 
229  // ID3DX10ThreadPump
230  STDMETHOD(AddWorkItem)(THIS_ ID3DX10DataLoader *pDataLoader, ID3DX10DataProcessor *pDataProcessor, HRESULT *pHResult, void **ppDeviceObject) PURE;
231  STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE;
232 
233  STDMETHOD(WaitForAllItems)(THIS) PURE;
234  STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT iWorkItemCount);
235 
236  STDMETHOD(PurgeAllItems)(THIS) PURE;
237  STDMETHOD(GetQueueStatus)(THIS_ UINT *pIoQueue, UINT *pProcessQueue, UINT *pDeviceQueue) PURE;
238 
239 };
240 
241 HRESULT WINAPI D3DX10CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump);
242 
243 
245 // ID3DX10Font:
246 // ----------
247 // Font objects contain the textures and resources needed to render a specific
248 // font on a specific device.
249 //
250 // GetGlyphData -
251 // Returns glyph cache data, for a given glyph.
252 //
253 // PreloadCharacters/PreloadGlyphs/PreloadText -
254 // Preloads glyphs into the glyph cache textures.
255 //
256 // DrawText -
257 // Draws formatted text on a D3D device. Some parameters are
258 // surprisingly similar to those of GDI's DrawText function. See GDI
259 // documentation for a detailed description of these parameters.
260 // If pSprite is NULL, an internal sprite object will be used.
261 //
263 
264 typedef struct _D3DX10_FONT_DESCA
265 {
271  BYTE CharSet;
273  BYTE Quality;
275  CHAR FaceName[LF_FACESIZE];
276 
278 
279 typedef struct _D3DX10_FONT_DESCW
280 {
286  BYTE CharSet;
288  BYTE Quality;
290  WCHAR FaceName[LF_FACESIZE];
291 
293 
294 #ifdef UNICODE
297 #else
300 #endif
301 
302 
303 typedef interface ID3DX10Font ID3DX10Font;
304 typedef interface ID3DX10Font *LPD3DX10FONT;
305 
306 
307 // {D79DBB70-5F21-4d36-BBC2-FF525C213CDC}
308 DEFINE_GUID(IID_ID3DX10Font,
309 0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc);
310 
311 
312 #undef INTERFACE
313 #define INTERFACE ID3DX10Font
314 
316 {
317  // IUnknown
318  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
319  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
320  STDMETHOD_(ULONG, Release)(THIS) PURE;
321 
322  // ID3DX10Font
323  STDMETHOD(GetDevice)(THIS_ ID3D10Device** ppDevice) PURE;
324  STDMETHOD(GetDescA)(THIS_ D3DX10_FONT_DESCA *pDesc) PURE;
325  STDMETHOD(GetDescW)(THIS_ D3DX10_FONT_DESCW *pDesc) PURE;
326  STDMETHOD_(BOOL, GetTextMetricsA)(THIS_ TEXTMETRICA *pTextMetrics) PURE;
327  STDMETHOD_(BOOL, GetTextMetricsW)(THIS_ TEXTMETRICW *pTextMetrics) PURE;
328 
329  STDMETHOD_(HDC, GetDC)(THIS) PURE;
330  STDMETHOD(GetGlyphData)(THIS_ UINT Glyph, ID3D10ShaderResourceView** ppTexture, RECT *pBlackBox, POINT *pCellInc) PURE;
331 
332  STDMETHOD(PreloadCharacters)(THIS_ UINT First, UINT Last) PURE;
333  STDMETHOD(PreloadGlyphs)(THIS_ UINT First, UINT Last) PURE;
334  STDMETHOD(PreloadTextA)(THIS_ LPCSTR pString, INT Count) PURE;
335  STDMETHOD(PreloadTextW)(THIS_ LPCWSTR pString, INT Count) PURE;
336 
337  STDMETHOD_(INT, DrawTextA)(THIS_ LPD3DX10SPRITE pSprite, LPCSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE;
338  STDMETHOD_(INT, DrawTextW)(THIS_ LPD3DX10SPRITE pSprite, LPCWSTR pString, INT Count, LPRECT pRect, UINT Format, D3DXCOLOR Color) PURE;
339 
340 #ifdef __cplusplus
341 #ifdef UNICODE
342  HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCW *pDesc) { return GetDescW(pDesc); }
343  HRESULT WINAPI_INLINE PreloadText(LPCWSTR pString, INT Count) { return PreloadTextW(pString, Count); }
344 #else
345  HRESULT WINAPI_INLINE GetDesc(D3DX10_FONT_DESCA *pDesc) { return GetDescA(pDesc); }
346  HRESULT WINAPI_INLINE PreloadText(LPCSTR pString, INT Count) { return PreloadTextA(pString, Count); }
347 #endif
348 #endif //__cplusplus
349 };
350 
351 #ifndef GetTextMetrics
352 #ifdef UNICODE
353 #define GetTextMetrics GetTextMetricsW
354 #else
355 #define GetTextMetrics GetTextMetricsA
356 #endif
357 #endif
358 
359 #ifndef DrawText
360 #ifdef UNICODE
361 #define DrawText DrawTextW
362 #else
363 #define DrawText DrawTextA
364 #endif
365 #endif
366 
367 
368 #ifdef __cplusplus
369 extern "C" {
370 #endif //__cplusplus
371 
372 
373 HRESULT WINAPI
375  ID3D10Device* pDevice,
376  INT Height,
377  UINT Width,
378  UINT Weight,
379  UINT MipLevels,
380  BOOL Italic,
381  UINT CharSet,
382  UINT OutputPrecision,
383  UINT Quality,
384  UINT PitchAndFamily,
385  LPCSTR pFaceName,
386  LPD3DX10FONT* ppFont);
387 
388 HRESULT WINAPI
390  ID3D10Device* pDevice,
391  INT Height,
392  UINT Width,
393  UINT Weight,
394  UINT MipLevels,
395  BOOL Italic,
396  UINT CharSet,
397  UINT OutputPrecision,
398  UINT Quality,
399  UINT PitchAndFamily,
400  LPCWSTR pFaceName,
401  LPD3DX10FONT* ppFont);
402 
403 #ifdef UNICODE
404 #define D3DX10CreateFont D3DX10CreateFontW
405 #else
406 #define D3DX10CreateFont D3DX10CreateFontA
407 #endif
408 
409 
410 HRESULT WINAPI
412  ID3D10Device* pDevice,
413  CONST D3DX10_FONT_DESCA* pDesc,
414  LPD3DX10FONT* ppFont);
415 
416 HRESULT WINAPI
418  ID3D10Device* pDevice,
419  CONST D3DX10_FONT_DESCW* pDesc,
420  LPD3DX10FONT* ppFont);
421 
422 #ifdef UNICODE
423 #define D3DX10CreateFontIndirect D3DX10CreateFontIndirectW
424 #else
425 #define D3DX10CreateFontIndirect D3DX10CreateFontIndirectA
426 #endif
427 
429 
430 #ifdef __cplusplus
431 }
432 #endif //__cplusplus
433 
435 
436 #define _FACD3D 0x876
437 #define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
438 #define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code )
439 
440 #define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156)
441 #define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540)
442 
443 #endif //__D3DX10CORE_H__
444 
struct _D3DX10_FONT_DESCA D3DX10_FONT_DESCA
D3DXCOLOR ColorModulate
Definition: d3dx10core.h:113
BOOL Italic
Definition: d3dx10core.h:270
interface ID3DX10Font * LPD3DX10FONT
Definition: d3dx10core.h:304
Definition: d3d8types.h:77
Definition: d3dx10core.h:99
BYTE PitchAndFamily
Definition: d3dx10core.h:274
interface ID3D10ShaderResourceView ID3D10ShaderResourceView
Definition: d3d10.h:119
UINT TextureIndex
Definition: d3dx10core.h:116
interface ID3DX10Font ID3DX10Font
Definition: d3dx10core.h:303
BYTE Quality
Definition: d3dx10core.h:288
BYTE CharSet
Definition: d3dx10core.h:271
HRESULT WINAPI D3DX10CreateSprite(ID3D10Device *pDevice, UINT cDeviceBufferSize, LPD3DX10SPRITE *ppSprite)
BYTE OutputPrecision
Definition: d3dx10core.h:272
struct _D3DX10_FONT_DESCA * LPD3DX10_FONT_DESCA
struct _D3DX10_FONT_DESCW * LPD3DX10_FONT_DESCW
D3DX10_FONT_DESCA D3DX10_FONT_DESC
Definition: d3dx10core.h:298
typedef HRESULT(WINAPI *PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(_In_ const D3D12_ROOT_SIGNATURE_DESC *pRootSignature
Definition: d3dx10core.h:103
D3DXMATRIX matWorld
Definition: d3dx10core.h:108
BYTE CharSet
Definition: d3dx10core.h:286
BYTE OutputPrecision
Definition: d3dx10core.h:287
HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *pAdapter, D3D10_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, IDXGISwapChain **ppSwapChain, ID3D10Device **ppDevice)
Definition: dxgi.h:285
enum _D3DX10_SPRITE_FLAG D3DX10_SPRITE_FLAG
DECLARE_INTERFACE_(ID3DX10Sprite, IUnknown)
Definition: d3dx10core.h:151
interface ID3D10Device1 ID3D10Device1
Definition: d3d10_1.h:63
UINT Weight
Definition: d3dx10core.h:268
INT Height
Definition: d3dx10core.h:281
HRESULT WINAPI D3DX10CheckVersion(UINT D3DSdkVersion, UINT D3DX10SdkVersion)
_D3DX10_SPRITE_FLAG
Definition: d3dx10core.h:97
HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *pDevice)
D3D10_DRIVER_TYPE
Definition: d3d10misc.h:36
HRESULT WINAPI D3DX10CreateFontIndirectA(ID3D10Device *pDevice, CONST D3DX10_FONT_DESCA *pDesc, LPD3DX10FONT *ppFont)
UINT MipLevels
Definition: d3dx10core.h:269
Definition: d3dx10core.h:101
DECLARE_INTERFACE(ID3DX10DataLoader)
Definition: d3dx10core.h:198
HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *pAdapter, D3D10_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, ID3D10Device **ppDevice)
interface IDXGISwapChain IDXGISwapChain
Definition: dxgi.h:100
UINT Width
Definition: d3dx10core.h:282
Definition: d3dx10core.h:264
HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *pDevice, ID3D10Device1 **ppDevice1)
INT Height
Definition: d3dx10core.h:266
ID3D10ShaderResourceView * pTexture
Definition: d3dx10core.h:115
CHAR FaceName[LF_FACESIZE]
Definition: d3dx10core.h:275
BYTE Quality
Definition: d3dx10core.h:273
LPD3DX10_FONT_DESCA LPD3DX10_FONT_DESC
Definition: d3dx10core.h:299
interface ID3D10Device ID3D10Device
Definition: d3d10.h:203
Definition: d3dx10core.h:106
D3DXVECTOR2 TexSize
Definition: d3dx10core.h:111
struct _D3DX10_SPRITE D3DX10_SPRITE
HRESULT WINAPI D3DX10CreateFontA(ID3D10Device *pDevice, INT Height, UINT Width, UINT Weight, UINT MipLevels, BOOL Italic, UINT CharSet, UINT OutputPrecision, UINT Quality, UINT PitchAndFamily, LPCSTR pFaceName, LPD3DX10FONT *ppFont)
static INLINE ULONG Release(void *object)
Definition: dxgi_common.h:253
Definition: d3dx8math.h:40
Definition: d3dx10core.h:100
static SRes Flush(CLzmaEnc *p, uint32_t nowPos)
Definition: LzmaEnc.c:1607
unsigned int BOOL
Definition: gctypes.h:51
BYTE PitchAndFamily
Definition: d3dx10core.h:289
DEFINE_GUID(IID_ID3DX10Sprite, 0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x6, 0x14)
UINT MipLevels
Definition: d3dx10core.h:284
Definition: glslang_tab.cpp:135
Definition: d3dx10core.h:279
Format
Definition: vulkan.hpp:7957
interface ID3DX10Sprite * LPD3DX10SPRITE
Definition: d3dx10core.h:140
Definition: glslang_tab.cpp:136
Definition: glslang_tab.cpp:133
interface IDXGIAdapter IDXGIAdapter
Definition: dxgi.h:86
BOOL Italic
Definition: d3dx10core.h:285
WCHAR FaceName[LF_FACESIZE]
Definition: d3dx10core.h:290
UINT Weight
Definition: d3dx10core.h:283
HRESULT WINAPI D3DX10CreateFontW(ID3D10Device *pDevice, INT Height, UINT Width, UINT Weight, UINT MipLevels, BOOL Italic, UINT CharSet, UINT OutputPrecision, UINT Quality, UINT PitchAndFamily, LPCWSTR pFaceName, LPD3DX10FONT *ppFont)
Definition: d3dx10core.h:102
GLbitfield flags
Definition: glext.h:7828
struct _D3DX10_FONT_DESCW D3DX10_FONT_DESCW
UINT Width
Definition: d3dx10core.h:267
Definition: d3dx8math.h:402
D3DXVECTOR2 TexCoord
Definition: d3dx10core.h:110
interface ID3DX10Sprite ID3DX10Sprite
Definition: d3dx10core.h:139
HRESULT WINAPI D3DX10CreateThreadPump(UINT cIoThreads, UINT cProcThreads, ID3DX10ThreadPump **ppThreadPump)
HRESULT WINAPI D3DX10CreateFontIndirectW(ID3D10Device *pDevice, CONST D3DX10_FONT_DESCW *pDesc, LPD3DX10FONT *ppFont)