Leaked source code of windows server 2003
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.

209 lines
9.9 KiB

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (C) Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: d3dxshapes.h
  6. // Content: D3DX simple shapes
  7. //
  8. ///////////////////////////////////////////////////////////////////////////
  9. #ifndef __D3DXSHAPES_H__
  10. #define __D3DXSHAPES_H__
  11. #include <d3d.h>
  12. #include <limits.h>
  13. #include "d3dxerr.h"
  14. typedef struct ID3DXSimpleShape *LPD3DXSIMPLESHAPE;
  15. // {CFCD4602-EB7B-11d2-A440-00A0C90629A8}
  16. DEFINE_GUID( IID_ID3DXSimpleShape,
  17. 0xcfcd4602, 0xeb7b, 0x11d2, 0xa4, 0x40, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8 );
  18. ///////////////////////////////////////////////////////////////////////////
  19. // Interfaces:
  20. ///////////////////////////////////////////////////////////////////////////
  21. //-------------------------------------------------------------------------
  22. // ID3DXSimpleShape interface:
  23. //-------------------------------------------------------------------------
  24. DECLARE_INTERFACE_(ID3DXSimpleShape, IUnknown)
  25. {
  26. // IUnknown methods
  27. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  28. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  29. STDMETHOD_(ULONG,Release)(THIS) PURE;
  30. // ID3DXSimpleShape methods
  31. STDMETHOD_(LPDIRECT3DVERTEXBUFFER7, GetVB)(THIS) PURE;
  32. STDMETHOD_(DWORD, GetIndices)(THIS_ LPWORD *ppIndices) PURE;
  33. STDMETHOD(Draw)(THIS) PURE;
  34. };
  35. ///////////////////////////////////////////////////////////////////////////
  36. // Functions:
  37. ///////////////////////////////////////////////////////////////////////////
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif //__cplusplus
  41. //-------------------------------------------------------------------------
  42. // D3DXCreatePolygon: Creates an 'n' sided polygon using the device
  43. // ---------------- specified. It returns a vertex buffer that can be used
  44. // for drawing or manipulation by the program later on.
  45. //
  46. // Params:
  47. // [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
  48. // [in] float sideSize: Length of a side.
  49. // [in] DWORD numTexCoords: The number of texture coordinates desired
  50. // in the vertex-buffer. (Default is 1)
  51. // D3DX_DEFAULT is a valid input.
  52. // [out] IDirect3DVertexBuffer7** ppVB: The output shape interface.
  53. //-------------------------------------------------------------------------
  54. HRESULT WINAPI
  55. D3DXCreatePolygon(LPDIRECT3DDEVICE7 pDevice,
  56. float sideSize,
  57. DWORD numSides,
  58. DWORD numTexCoords,
  59. LPD3DXSIMPLESHAPE* ppShape );
  60. //-------------------------------------------------------------------------
  61. // D3DXCreateBox: Creates a box (cuboid) of given dimensions using the
  62. // ------------ device. It returns a vertex buffer that can
  63. // be used for drawing or manipulation by the program later on.
  64. //
  65. // Params:
  66. // [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
  67. // [in] float width: Width of the box (along x-axis)
  68. // [in] float height: Height of the box (along y-axis)
  69. // [in] float depth: Depth of the box (along z-axis)
  70. // [in] DWORD numTexCoords: The number of texture coordinates desired
  71. // in the vertex-buffer. Default is 1.
  72. // D3DX_DEFAULT is a valid input here.
  73. // [out] LPD3DXSIMPLESHAPE* ppShape: The output vertex-buffer.
  74. //-------------------------------------------------------------------------
  75. HRESULT WINAPI
  76. D3DXCreateBox(LPDIRECT3DDEVICE7 pDevice,
  77. float width,
  78. float height,
  79. float depth,
  80. DWORD numTexCoords,
  81. LPD3DXSIMPLESHAPE* ppShape );
  82. //-------------------------------------------------------------------------
  83. // D3DXCreateCylinder: Creates a cylinder of given dimensions using the
  84. // ----------------- device. It returns a vertex buffer that
  85. // can be used for drawing or manipulation by the program
  86. // later on.
  87. //
  88. // Params:
  89. // [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
  90. // [in] float baseRadius: Base-radius (default is 1.0f, shd be >= 0.0f)
  91. // [in] float topRadius: Top-radius (default is 1.0f, shd be >= 0.0f)
  92. // [in] float height: Height (default is 1.0f, shd be >= 0.0f)
  93. // [in] DWORD numSlices: Number of slices about the main axis.
  94. // (default is 8) D3DX_DEFAULT is a valid input.
  95. // [in] DWORD numStacks: Number of stacks along the main axis.
  96. // (default is 8) D3DX_DEFAULT is a valid input.
  97. // [in] DWORD numTexCoords: The number of texture coordinates desired
  98. // in the vertex-buffer. Default is 1.
  99. // D3DX_DEFAULT is a valid input here.
  100. // [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface.
  101. //-------------------------------------------------------------------------
  102. HRESULT WINAPI
  103. D3DXCreateCylinder(LPDIRECT3DDEVICE7 pDevice,
  104. float baseRadius,
  105. float topRadius,
  106. float height,
  107. DWORD numSlices,
  108. DWORD numStacks,
  109. DWORD numTexCoords,
  110. LPD3DXSIMPLESHAPE* ppShape );
  111. //-------------------------------------------------------------------------
  112. // D3DXCreateTorus: Creates a torus of given dimensions using the
  113. // -------------- device specified. It returns a vertex buffer that can
  114. // be used for drawing or manipulation by the program later
  115. // on. It draws a doughnut, centered at (0, 0, 0) whose axis
  116. // is aligned with the z-axis. With the innerRadius used
  117. // as the radius of the cross-section (minor-Radius) and
  118. // the outerRadius used as the radius of the central 'hole'.
  119. //
  120. // Params:
  121. // [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
  122. // [in] float innerRadius: inner radius (default is 1.0f, shd be >= 0.0f)
  123. // [in] float outerRadius: outer radius (default is 2.0f, shd be >= 0.0f)
  124. // [in] DWORD numSides: Number of sides in the cross-section
  125. // (default is 8). D3DX_DEFAULT is a valid input.
  126. // [in] DWORD numRings: Number of rings making up the torus
  127. // (default is 8) D3DX_DEFAULT is a valid input.
  128. // [in] DWORD numTexCoords: The number of texture coordinates desired
  129. // in the vertex-buffer. Default is 1.
  130. // D3DX_DEFAULT is a valid input here.
  131. // [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface.
  132. //-------------------------------------------------------------------------
  133. HRESULT WINAPI
  134. D3DXCreateTorus(LPDIRECT3DDEVICE7 pDevice,
  135. float innerRadius,
  136. float outerRadius,
  137. DWORD numSides,
  138. DWORD numRings,
  139. DWORD numTexCoords,
  140. LPD3DXSIMPLESHAPE* ppShape );
  141. //-------------------------------------------------------------------------
  142. // D3DXCreateTeapot: Creates a teapot using the device specified.
  143. // ---------------- It returns a vertex buffer that can be used for
  144. // drawing or manipulation by the program later on.
  145. //
  146. // Params:
  147. // [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
  148. // [in] DWORD numTexCoords: The number of texture coordinates desired
  149. // in the vertex-buffer. Default is 1.
  150. // D3DX_DEFAULT is a valid input here.
  151. // [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface.
  152. //-------------------------------------------------------------------------
  153. HRESULT WINAPI
  154. D3DXCreateTeapot(LPDIRECT3DDEVICE7 pDevice,
  155. DWORD numTexCoords,
  156. LPD3DXSIMPLESHAPE* ppShape);
  157. //-------------------------------------------------------------------------
  158. // D3DXCreateSphere: Creates a cylinder of given dimensions using the
  159. // ---------------- device specified.
  160. // It returns a vertex buffer that can be used for
  161. // drawing or manipulation by the program later on.
  162. //
  163. // Params:
  164. // [in] LPDIRECT3DDEVICE7 pDevice: The device to create off.
  165. // [in] float radius: radius (default is 1.0f, shd be >= 0.0f)
  166. // [in] float height: Height (default is 1.0f, shd be >= 0.0f)
  167. // [in] DWORD numSlices: Number of slices about the main axis
  168. // (default is 8) D3DX_DEFAULT is a valid input.
  169. // [in] DWORD numStacks: Number of stacks along the main axis
  170. // (default is 8) D3DX_DEFAULT is a valid input.
  171. // [in] DWORD numTexCoords: The number of texture coordinates desired
  172. // in the vertex-buffer. Default is 1.
  173. // D3DX_DEFAULT is a valid input here.
  174. // [out] LPD3DXSIMPLESHAPE* ppShape: The output shape interface.
  175. //-------------------------------------------------------------------------
  176. HRESULT WINAPI
  177. D3DXCreateSphere(LPDIRECT3DDEVICE7 pDevice,
  178. float radius,
  179. DWORD numSlices,
  180. DWORD numStacks,
  181. DWORD numTexCoords,
  182. LPD3DXSIMPLESHAPE* ppShape);
  183. #ifdef __cplusplus
  184. }
  185. #endif //__cplusplus
  186. #endif //__D3DXSHAPES_H__