1 module directx.d3d10misc;
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 //  Copyright (c) Microsoft Corporation.  All rights reserved.
5 //
6 //  File:       D3D10Misc.h
7 //  Content:    D3D10 Device Creation APIs
8 //
9 //////////////////////////////////////////////////////////////////////////////
10 
11 public import directx.d3d10;
12 
13 alias DWORD D3D10_DRIVER_TYPE;
14 enum : D3D10_DRIVER_TYPE {
15     D3D10_DRIVER_TYPE_HARDWARE   = 0,
16     D3D10_DRIVER_TYPE_REFERENCE  = 1,
17     D3D10_DRIVER_TYPE_NULL       = 2,
18     D3D10_DRIVER_TYPE_SOFTWARE   = 3,
19     D3D10_DRIVER_TYPE_WARP       = 5
20 }
21 
22 ///////////////////////////////////////////////////////////////////////////
23 // D3D10CreateDevice
24 // ------------------
25 //
26 // pAdapter
27 //      If NULL, D3D10CreateDevice will choose the primary adapter and
28 //      create a new instance from a temporarily created IDXGIFactory.
29 //      If non-NULL, D3D10CreateDevice will register the appropriate
30 //      device, if necessary (via IDXGIAdapter::RegisterDrver), before
31 //      creating the device.
32 // DriverType
33 //      Specifies the driver type to be created: hardware, reference or
34 //      null.
35 // Software
36 //      HMODULE of a DLL implementing a software rasterizer. Must be NULL for
37 //      non-Software driver types.
38 // Flags
39 //      Any of those documented for D3D10CreateDevice.
40 // SDKVersion
41 //      SDK version. Use the D3D10_SDK_VERSION macro.
42 // ppDevice
43 //      Pointer to returned interface.
44 //
45 // Return Values
46 //  Any of those documented for
47 //          CreateDXGIFactory
48 //          IDXGIFactory::EnumAdapters
49 //          IDXGIAdapter::RegisterDriver
50 //          D3D10CreateDevice
51 //
52 ///////////////////////////////////////////////////////////////////////////
53 
54 __gshared _D3D10CreateDevice D3D10CreateDevice;
55 
56 extern (Windows) {
57     alias _D3D10CreateDevice = HRESULT function(IDXGIAdapter      pAdapter,
58                                                 D3D10_DRIVER_TYPE DriverType,
59                                                 HMODULE           Software,
60                                                 UINT              Flags,
61                                                 UINT              SDKVersion,
62                                                 ID3D10Device      *ppDevice);
63 }
64 
65 ///////////////////////////////////////////////////////////////////////////
66 // D3D10CreateDeviceAndSwapChain
67 // ------------------------------
68 //
69 // ppAdapter
70 //      If NULL, D3D10CreateDevice will choose the primary adapter and
71 //      create a new instance from a temporarily created IDXGIFactory.
72 //      If non-NULL, D3D10CreateDevice will register the appropriate
73 //      device, if necessary (via IDXGIAdapter::RegisterDrver), before
74 //      creating the device.
75 // DriverType
76 //      Specifies the driver type to be created: hardware, reference or
77 //      null.
78 // Software
79 //      HMODULE of a DLL implementing a software rasterizer. Must be NULL for
80 //      non-Software driver types.
81 // Flags
82 //      Any of those documented for D3D10CreateDevice.
83 // SDKVersion
84 //      SDK version. Use the D3D10_SDK_VERSION macro.
85 // pSwapChainDesc
86 //      Swap chain description, may be NULL.
87 // ppSwapChain
88 //      Pointer to returned interface. May be NULL.
89 // ppDevice
90 //      Pointer to returned interface.
91 //
92 // Return Values
93 //  Any of those documented for
94 //          CreateDXGIFactory
95 //          IDXGIFactory::EnumAdapters
96 //          IDXGIAdapter::RegisterDriver
97 //          D3D10CreateDevice
98 //          IDXGIFactory::CreateSwapChain
99 //
100 ///////////////////////////////////////////////////////////////////////////
101 
102 __gshared _D3D10CreateDeviceAndSwapChain D3D10CreateDeviceAndSwapChain;
103 
104 extern (Windows) {
105     alias _D3D10CreateDeviceAndSwapChain = HRESULT function(
106         IDXGIAdapter pAdapter,
107         D3D10_DRIVER_TYPE DriverType,
108         HMODULE Software,
109         UINT Flags,
110         UINT SDKVersion,
111         DXGI_SWAP_CHAIN_DESC* pSwapChainDesc,
112         IDXGISwapChain* ppSwapChain,
113         ID3D10Device* ppDevice);
114 }
115 
116 ///////////////////////////////////////////////////////////////////////////
117 // D3D10CreateBlob:
118 // -----------------
119 // Creates a Buffer of n Bytes
120 //////////////////////////////////////////////////////////////////////////
121 
122 __gshared _D3D10CreateBlob D3D10CreateBlob;
123 
124 alias _D3D10CreateBlob = HRESULT function(SIZE_T NumBytes, LPD3D10BLOB ppBuffer);