Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

175 lines
5.3 KiB

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