|
5 | 5 | * The Windows 7.x Platform SDK (bundled with MSVC 2010 and earlier) |
6 | 6 | * does not ship dxguid.lib. Rather than require the legacy June 2010 |
7 | 7 | * DirectX SDK just to pick up a handful of IID_* / CLSID_* constants, |
8 | | - * we define them ourselves in this single translation unit. |
| 8 | + * we define them ourselves. |
9 | 9 | * |
10 | 10 | * Including <initguid.h> before any DX header causes DEFINE_GUID() to |
11 | 11 | * expand to actual storage rather than extern references. Every other |
12 | 12 | * TU in the program continues to see the default extern declarations |
13 | 13 | * and resolves the GUIDs to the storage defined here at link time. |
14 | 14 | * |
| 15 | + * GUID storage for the modern (DXGI-based) DX stack lives in this file |
| 16 | + * (D3D10/11/12, DXGI, D3DCompiler, DInput, XAudio). The legacy pre-DXGI |
| 17 | + * stack lives in two separate TUs: |
| 18 | + * * gfx/common/dx_guids_d3d9.c |
| 19 | + * * gfx/common/dx_guids_d3d8.c |
| 20 | + * because <d3d8.h> / <d3d9.h> and <d3d11.h> / <dxgi.h> cannot share a |
| 21 | + * single TU portably -- system <d3d8types.h> / <d3d9types.h> headers |
| 22 | + * (notably mingw-w64) do not honor the D3DCOLORVALUE_DEFINED guard |
| 23 | + * used by the bundled gfx/include/dxsdk headers, and redefine |
| 24 | + * D3DCOLORVALUE / D3DVECTOR / D3DMATRIX. Splitting per header family |
| 25 | + * sidesteps that altogether. |
| 26 | + * |
15 | 27 | * IMPORTANT: no other TU in the program may include <initguid.h> |
16 | 28 | * before DirectX headers, or the linker will report duplicate symbols |
17 | 29 | * for IID_* / CLSID_* constants. |
|
42 | 54 | #ifdef HAVE_D3D10 |
43 | 55 | #include <d3d10.h> |
44 | 56 | #endif |
45 | | -#ifdef HAVE_D3D9 |
46 | | -#include <d3d9.h> |
47 | | -#endif |
48 | | -#ifdef HAVE_D3D8 |
49 | | -#include <d3d8.h> |
50 | | -#endif |
| 57 | +/* HAVE_D3D9: emitted in gfx/common/dx_guids_d3d9.c */ |
| 58 | +/* HAVE_D3D8: emitted in gfx/common/dx_guids_d3d8.c */ |
51 | 59 |
|
52 | 60 | #if defined(HAVE_D3D10) || defined(HAVE_D3D11) || defined(HAVE_D3D12) \ |
53 | 61 | || (defined(HAVE_D3D9) && defined(HAVE_HLSL)) |
|
0 commit comments