d3dx8shape.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:8k
源码类别:

模拟服务器

开发平台:

C/C++

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
  4. //
  5. //  File:       d3dx8shapes.h
  6. //  Content:    D3DX simple shapes
  7. //
  8. ///////////////////////////////////////////////////////////////////////////
  9. #include "d3dx8.h"
  10. #ifndef __D3DX8SHAPES_H__
  11. #define __D3DX8SHAPES_H__
  12. ///////////////////////////////////////////////////////////////////////////
  13. // Functions:
  14. ///////////////////////////////////////////////////////////////////////////
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif //__cplusplus
  18. //-------------------------------------------------------------------------
  19. // D3DXCreatePolygon: 
  20. // ------------------
  21. // Creates a mesh containing an n-sided polygon.  The polygon is centered
  22. // at the origin.
  23. //
  24. // Parameters:
  25. //
  26. //  pDevice     The D3D device with which the mesh is going to be used.
  27. //  Length      Length of each side.
  28. //  Sides       Number of sides the polygon has.  (Must be >= 3)
  29. //  ppMesh      The mesh object which will be created
  30. //  ppAdjacency Returns a buffer containing adjacency info.  Can be NULL.
  31. //-------------------------------------------------------------------------
  32. HRESULT WINAPI 
  33.     D3DXCreatePolygon(
  34.         LPDIRECT3DDEVICE8   pDevice,
  35.         FLOAT               Length, 
  36.         UINT                Sides, 
  37.         LPD3DXMESH*         ppMesh,
  38.         LPD3DXBUFFER*       ppAdjacency);
  39. //-------------------------------------------------------------------------
  40. // D3DXCreateBox: 
  41. // --------------
  42. // Creates a mesh containing an axis-aligned box.  The box is centered at
  43. // the origin.
  44. //
  45. // Parameters:
  46. //
  47. //  pDevice     The D3D device with which the mesh is going to be used.
  48. //  Width       Width of box (along X-axis)
  49. //  Height      Height of box (along Y-axis)
  50. //  Depth       Depth of box (along Z-axis)
  51. //  ppMesh      The mesh object which will be created
  52. //  ppAdjacency Returns a buffer containing adjacency info.  Can be NULL.
  53. //-------------------------------------------------------------------------
  54. HRESULT WINAPI 
  55.     D3DXCreateBox(
  56.         LPDIRECT3DDEVICE8   pDevice, 
  57.         FLOAT               Width,
  58.         FLOAT               Height,
  59.         FLOAT               Depth,
  60.         LPD3DXMESH*         ppMesh,
  61.         LPD3DXBUFFER*       ppAdjacency);
  62. //-------------------------------------------------------------------------
  63. // D3DXCreateCylinder:
  64. // -------------------
  65. // Creates a mesh containing a cylinder.  The generated cylinder is
  66. // centered at the origin, and its axis is aligned with the Z-axis.
  67. //
  68. // Parameters:
  69. //
  70. //  pDevice     The D3D device with which the mesh is going to be used.
  71. //  Radius1     Radius at -Z end (should be >= 0.0f)
  72. //  Radius2     Radius at +Z end (should be >= 0.0f)
  73. //  Length      Length of cylinder (along Z-axis)
  74. //  Slices      Number of slices about the main axis
  75. //  Stacks      Number of stacks along the main axis
  76. //  ppMesh      The mesh object which will be created
  77. //  ppAdjacency Returns a buffer containing adjacency info.  Can be NULL.
  78. //-------------------------------------------------------------------------
  79. HRESULT WINAPI 
  80.     D3DXCreateCylinder(
  81.         LPDIRECT3DDEVICE8   pDevice,
  82.         FLOAT               Radius1, 
  83.         FLOAT               Radius2, 
  84.         FLOAT               Length, 
  85.         UINT                Slices, 
  86.         UINT                Stacks,   
  87.         LPD3DXMESH*         ppMesh,
  88.         LPD3DXBUFFER*       ppAdjacency);
  89. //-------------------------------------------------------------------------
  90. // D3DXCreateSphere:
  91. // -----------------
  92. // Creates a mesh containing a sphere.  The sphere is centered at the
  93. // origin.
  94. //
  95. // Parameters:
  96. //
  97. //  pDevice     The D3D device with which the mesh is going to be used.
  98. //  Radius      Radius of the sphere (should be >= 0.0f)
  99. //  Slices      Number of slices about the main axis
  100. //  Stacks      Number of stacks along the main axis
  101. //  ppMesh      The mesh object which will be created
  102. //  ppAdjacency Returns a buffer containing adjacency info.  Can be NULL.
  103. //-------------------------------------------------------------------------
  104. HRESULT WINAPI
  105.     D3DXCreateSphere(
  106.         LPDIRECT3DDEVICE8  pDevice, 
  107.         FLOAT              Radius, 
  108.         UINT               Slices, 
  109.         UINT               Stacks,
  110.         LPD3DXMESH*        ppMesh,
  111.         LPD3DXBUFFER*      ppAdjacency);
  112. //-------------------------------------------------------------------------
  113. // D3DXCreateTorus:
  114. // ----------------
  115. // Creates a mesh containing a torus.  The generated torus is centered at
  116. // the origin, and its axis is aligned with the Z-axis.
  117. //
  118. // Parameters: 
  119. //
  120. //  pDevice     The D3D device with which the mesh is going to be used.
  121. //  InnerRadius Inner radius of the torus (should be >= 0.0f)
  122. //  OuterRadius Outer radius of the torue (should be >= 0.0f)
  123. //  Sides       Number of sides in a cross-section (must be >= 3)
  124. //  Rings       Number of rings making up the torus (must be >= 3)
  125. //  ppMesh      The mesh object which will be created
  126. //  ppAdjacency Returns a buffer containing adjacency info.  Can be NULL.
  127. //-------------------------------------------------------------------------
  128. HRESULT WINAPI
  129.     D3DXCreateTorus(
  130.         LPDIRECT3DDEVICE8   pDevice,
  131.         FLOAT               InnerRadius,
  132.         FLOAT               OuterRadius, 
  133.         UINT                Sides,
  134.         UINT                Rings, 
  135.         LPD3DXMESH*         ppMesh,
  136.         LPD3DXBUFFER*       ppAdjacency);
  137. //-------------------------------------------------------------------------
  138. // D3DXCreateTeapot: 
  139. // -----------------
  140. // Creates a mesh containing a teapot.
  141. //
  142. // Parameters: 
  143. //
  144. //  pDevice     The D3D device with which the mesh is going to be used.
  145. //  ppMesh      The mesh object which will be created
  146. //  ppAdjacency Returns a buffer containing adjacency info.  Can be NULL.
  147. //-------------------------------------------------------------------------
  148. HRESULT WINAPI
  149.     D3DXCreateTeapot(
  150.         LPDIRECT3DDEVICE8   pDevice,
  151.         LPD3DXMESH*         ppMesh,
  152.         LPD3DXBUFFER*       ppAdjacency);
  153. //-------------------------------------------------------------------------
  154. // D3DXCreateText: 
  155. // --------------- 
  156. // Creates a mesh containing the specified text using the font associated
  157. // with the device context.
  158. //
  159. // Parameters:
  160. //
  161. //  pDevice       The D3D device with which the mesh is going to be used.
  162. //  hDC           Device context, with desired font selected
  163. //  pText         Text to generate
  164. //  Deviation     Maximum chordal deviation from true font outlines
  165. //  Extrusion     Amount to extrude text in -Z direction
  166. //  ppMesh        The mesh object which will be created
  167. //  pGlyphMetrics Address of buffer to receive glyph metric data (or NULL)
  168. //-------------------------------------------------------------------------
  169. HRESULT WINAPI
  170.     D3DXCreateTextA(
  171.         LPDIRECT3DDEVICE8   pDevice,
  172.         HDC                 hDC,
  173.         LPCSTR              pText,
  174.         FLOAT               Deviation,
  175.         FLOAT               Extrusion,
  176.         LPD3DXMESH*         ppMesh,
  177.         LPD3DXBUFFER*       ppAdjacency,
  178.         LPGLYPHMETRICSFLOAT pGlyphMetrics);
  179. HRESULT WINAPI
  180.     D3DXCreateTextW(
  181.         LPDIRECT3DDEVICE8   pDevice,
  182.         HDC                 hDC,
  183.         LPCWSTR             pText,
  184.         FLOAT               Deviation,
  185.         FLOAT               Extrusion,
  186.         LPD3DXMESH*         ppMesh,
  187.         LPD3DXBUFFER*       ppAdjacency,
  188.         LPGLYPHMETRICSFLOAT pGlyphMetrics);
  189. #ifdef UNICODE
  190. #define D3DXCreateText D3DXCreateTextW
  191. #else
  192. #define D3DXCreateText D3DXCreateTextA
  193. #endif
  194. #ifdef __cplusplus
  195. }
  196. #endif //__cplusplus    
  197. #endif //__D3DX8SHAPES_H__