Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | pmbaty | 1 | ////////////////////////////////////////////////////////////////////////////// |
| 2 | // |
||
| 3 | // Copyright (c) Microsoft Corporation. All rights reserved. |
||
| 4 | // |
||
| 5 | // File: D3D10Misc.h |
||
| 6 | // Content: D3D10 Device Creation APIs |
||
| 7 | // |
||
| 8 | ////////////////////////////////////////////////////////////////////////////// |
||
| 9 | |||
| 10 | #ifndef __D3D10MISC_H__ |
||
| 11 | #define __D3D10MISC_H__ |
||
| 12 | |||
| 13 | #include "d3d10.h" |
||
| 14 | |||
| 15 | /////////////////////////////////////////////////////////////////////////// |
||
| 16 | // ID3D10Blob: |
||
| 17 | // ------------ |
||
| 18 | // The buffer object is used by D3D10 to return arbitrary size data. |
||
| 19 | // |
||
| 20 | // GetBufferPointer - |
||
| 21 | // Returns a pointer to the beginning of the buffer. |
||
| 22 | // |
||
| 23 | // GetBufferSize - |
||
| 24 | // Returns the size of the buffer, in bytes. |
||
| 25 | /////////////////////////////////////////////////////////////////////////// |
||
| 26 | |||
| 27 | typedef interface ID3D10Blob ID3D10Blob; |
||
| 28 | typedef interface ID3D10Blob *LPD3D10BLOB; |
||
| 29 | |||
| 30 | // {8BA5FB08-5195-40e2-AC58-0D989C3A0102} |
||
| 31 | DEFINE_GUID(IID_ID3D10Blob, |
||
| 32 | 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2); |
||
| 33 | |||
| 34 | #undef INTERFACE |
||
| 35 | #define INTERFACE ID3D10Blob |
||
| 36 | |||
| 37 | DECLARE_INTERFACE_(ID3D10Blob, IUnknown) |
||
| 38 | { |
||
| 39 | // IUnknown |
||
| 40 | STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; |
||
| 41 | STDMETHOD_(ULONG, AddRef)(THIS) PURE; |
||
| 42 | STDMETHOD_(ULONG, Release)(THIS) PURE; |
||
| 43 | |||
| 44 | // ID3D10Blob |
||
| 45 | STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; |
||
| 46 | STDMETHOD_(SIZE_T, GetBufferSize)(THIS) PURE; |
||
| 47 | }; |
||
| 48 | |||
| 49 | #ifdef __cplusplus |
||
| 50 | extern "C" { |
||
| 51 | #endif //__cplusplus |
||
| 52 | |||
| 53 | /////////////////////////////////////////////////////////////////////////// |
||
| 54 | // D3D10_DRIVER_TYPE |
||
| 55 | // ---------------- |
||
| 56 | // |
||
| 57 | // This identifier is used to determine the implementation of Direct3D10 |
||
| 58 | // to be used. |
||
| 59 | // |
||
| 60 | // Pass one of these values to D3D10CreateDevice |
||
| 61 | // |
||
| 62 | /////////////////////////////////////////////////////////////////////////// |
||
| 63 | typedef enum D3D10_DRIVER_TYPE |
||
| 64 | { |
||
| 65 | D3D10_DRIVER_TYPE_HARDWARE = 0, |
||
| 66 | D3D10_DRIVER_TYPE_REFERENCE = 1, |
||
| 67 | D3D10_DRIVER_TYPE_NULL = 2, |
||
| 68 | D3D10_DRIVER_TYPE_SOFTWARE = 3, |
||
| 69 | D3D10_DRIVER_TYPE_WARP = 5, |
||
| 70 | } D3D10_DRIVER_TYPE; |
||
| 71 | |||
| 72 | DEFINE_GUID(GUID_DeviceType, |
||
| 73 | 0xd722fb4d, 0x7a68, 0x437a, 0xb2, 0x0c, 0x58, 0x04, 0xee, 0x24, 0x94, 0xa6); |
||
| 74 | |||
| 75 | /////////////////////////////////////////////////////////////////////////// |
||
| 76 | // D3D10CreateDevice |
||
| 77 | // ------------------ |
||
| 78 | // |
||
| 79 | // pAdapter |
||
| 80 | // If NULL, D3D10CreateDevice will choose the primary adapter and |
||
| 81 | // create a new instance from a temporarily created IDXGIFactory. |
||
| 82 | // If non-NULL, D3D10CreateDevice will register the appropriate |
||
| 83 | // device, if necessary (via IDXGIAdapter::RegisterDrver), before |
||
| 84 | // creating the device. |
||
| 85 | // DriverType |
||
| 86 | // Specifies the driver type to be created: hardware, reference or |
||
| 87 | // null. |
||
| 88 | // Software |
||
| 89 | // HMODULE of a DLL implementing a software rasterizer. Must be NULL for |
||
| 90 | // non-Software driver types. |
||
| 91 | // Flags |
||
| 92 | // Any of those documented for D3D10CreateDevice. |
||
| 93 | // SDKVersion |
||
| 94 | // SDK version. Use the D3D10_SDK_VERSION macro. |
||
| 95 | // ppDevice |
||
| 96 | // Pointer to returned interface. |
||
| 97 | // |
||
| 98 | // Return Values |
||
| 99 | // Any of those documented for |
||
| 100 | // CreateDXGIFactory |
||
| 101 | // IDXGIFactory::EnumAdapters |
||
| 102 | // IDXGIAdapter::RegisterDriver |
||
| 103 | // D3D10CreateDevice |
||
| 104 | // |
||
| 105 | /////////////////////////////////////////////////////////////////////////// |
||
| 106 | HRESULT WINAPI D3D10CreateDevice( |
||
| 107 | IDXGIAdapter *pAdapter, |
||
| 108 | D3D10_DRIVER_TYPE DriverType, |
||
| 109 | HMODULE Software, |
||
| 110 | UINT Flags, |
||
| 111 | UINT SDKVersion, |
||
| 112 | ID3D10Device **ppDevice); |
||
| 113 | |||
| 114 | /////////////////////////////////////////////////////////////////////////// |
||
| 115 | // D3D10CreateDeviceAndSwapChain |
||
| 116 | // ------------------------------ |
||
| 117 | // |
||
| 118 | // ppAdapter |
||
| 119 | // If NULL, D3D10CreateDevice will choose the primary adapter and |
||
| 120 | // create a new instance from a temporarily created IDXGIFactory. |
||
| 121 | // If non-NULL, D3D10CreateDevice will register the appropriate |
||
| 122 | // device, if necessary (via IDXGIAdapter::RegisterDrver), before |
||
| 123 | // creating the device. |
||
| 124 | // DriverType |
||
| 125 | // Specifies the driver type to be created: hardware, reference or |
||
| 126 | // null. |
||
| 127 | // Software |
||
| 128 | // HMODULE of a DLL implementing a software rasterizer. Must be NULL for |
||
| 129 | // non-Software driver types. |
||
| 130 | // Flags |
||
| 131 | // Any of those documented for D3D10CreateDevice. |
||
| 132 | // SDKVersion |
||
| 133 | // SDK version. Use the D3D10_SDK_VERSION macro. |
||
| 134 | // pSwapChainDesc |
||
| 135 | // Swap chain description, may be NULL. |
||
| 136 | // ppSwapChain |
||
| 137 | // Pointer to returned interface. May be NULL. |
||
| 138 | // ppDevice |
||
| 139 | // Pointer to returned interface. |
||
| 140 | // |
||
| 141 | // Return Values |
||
| 142 | // Any of those documented for |
||
| 143 | // CreateDXGIFactory |
||
| 144 | // IDXGIFactory::EnumAdapters |
||
| 145 | // IDXGIAdapter::RegisterDriver |
||
| 146 | // D3D10CreateDevice |
||
| 147 | // IDXGIFactory::CreateSwapChain |
||
| 148 | // |
||
| 149 | /////////////////////////////////////////////////////////////////////////// |
||
| 150 | HRESULT WINAPI D3D10CreateDeviceAndSwapChain( |
||
| 151 | IDXGIAdapter *pAdapter, |
||
| 152 | D3D10_DRIVER_TYPE DriverType, |
||
| 153 | HMODULE Software, |
||
| 154 | UINT Flags, |
||
| 155 | UINT SDKVersion, |
||
| 156 | DXGI_SWAP_CHAIN_DESC *pSwapChainDesc, |
||
| 157 | IDXGISwapChain **ppSwapChain, |
||
| 158 | ID3D10Device **ppDevice); |
||
| 159 | |||
| 160 | |||
| 161 | /////////////////////////////////////////////////////////////////////////// |
||
| 162 | // D3D10CreateBlob: |
||
| 163 | // ----------------- |
||
| 164 | // Creates a Buffer of n Bytes |
||
| 165 | ////////////////////////////////////////////////////////////////////////// |
||
| 166 | |||
| 167 | HRESULT WINAPI D3D10CreateBlob(SIZE_T NumBytes, LPD3D10BLOB *ppBuffer); |
||
| 168 | |||
| 169 | #ifdef __cplusplus |
||
| 170 | } |
||
| 171 | #endif //__cplusplus |
||
| 172 | |||
| 173 | #endif //__D3D10EFFECT_H__ |
||
| 174 | |||
| 175 |