1 ///////////////////////////////////////////////////////////////////////////
3 // Copyright (C) Microsoft Corporation. All Rights Reserved.
6 // Content: D3DX simple shapes
8 ///////////////////////////////////////////////////////////////////////////
12 #ifndef __D3DX9SHAPES_H__
13 #define __D3DX9SHAPES_H__
15 ///////////////////////////////////////////////////////////////////////////
17 ///////////////////////////////////////////////////////////////////////////
24 //-------------------------------------------------------------------------
27 // Creates a mesh containing an n-sided polygon. The polygon is centered
32 // pDevice The D3D device with which the mesh is going to be used.
33 // Length Length of each side.
34 // Sides Number of sides the polygon has. (Must be >= 3)
35 // ppMesh The mesh object which will be created
36 // ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
37 //-------------------------------------------------------------------------
40 LPDIRECT3DDEVICE9 pDevice
,
44 LPD3DXBUFFER
* ppAdjacency
);
47 //-------------------------------------------------------------------------
50 // Creates a mesh containing an axis-aligned box. The box is centered at
55 // pDevice The D3D device with which the mesh is going to be used.
56 // Width Width of box (along X-axis)
57 // Height Height of box (along Y-axis)
58 // Depth Depth of box (along Z-axis)
59 // ppMesh The mesh object which will be created
60 // ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
61 //-------------------------------------------------------------------------
64 LPDIRECT3DDEVICE9 pDevice
,
69 LPD3DXBUFFER
* ppAdjacency
);
72 //-------------------------------------------------------------------------
73 // D3DXCreateCylinder:
74 // -------------------
75 // Creates a mesh containing a cylinder. The generated cylinder is
76 // centered at the origin, and its axis is aligned with the Z-axis.
80 // pDevice The D3D device with which the mesh is going to be used.
81 // Radius1 Radius at -Z end (should be >= 0.0f)
82 // Radius2 Radius at +Z end (should be >= 0.0f)
83 // Length Length of cylinder (along Z-axis)
84 // Slices Number of slices about the main axis
85 // Stacks Number of stacks along the main axis
86 // ppMesh The mesh object which will be created
87 // ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
88 //-------------------------------------------------------------------------
91 LPDIRECT3DDEVICE9 pDevice
,
98 LPD3DXBUFFER
* ppAdjacency
);
101 //-------------------------------------------------------------------------
104 // Creates a mesh containing a sphere. The sphere is centered at the
109 // pDevice The D3D device with which the mesh is going to be used.
110 // Radius Radius of the sphere (should be >= 0.0f)
111 // Slices Number of slices about the main axis
112 // Stacks Number of stacks along the main axis
113 // ppMesh The mesh object which will be created
114 // ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
115 //-------------------------------------------------------------------------
118 LPDIRECT3DDEVICE9 pDevice
,
123 LPD3DXBUFFER
* ppAdjacency
);
126 //-------------------------------------------------------------------------
129 // Creates a mesh containing a torus. The generated torus is centered at
130 // the origin, and its axis is aligned with the Z-axis.
134 // pDevice The D3D device with which the mesh is going to be used.
135 // InnerRadius Inner radius of the torus (should be >= 0.0f)
136 // OuterRadius Outer radius of the torue (should be >= 0.0f)
137 // Sides Number of sides in a cross-section (must be >= 3)
138 // Rings Number of rings making up the torus (must be >= 3)
139 // ppMesh The mesh object which will be created
140 // ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
141 //-------------------------------------------------------------------------
144 LPDIRECT3DDEVICE9 pDevice
,
150 LPD3DXBUFFER
* ppAdjacency
);
153 //-------------------------------------------------------------------------
156 // Creates a mesh containing a teapot.
160 // pDevice The D3D device with which the mesh is going to be used.
161 // ppMesh The mesh object which will be created
162 // ppAdjacency Returns a buffer containing adjacency info. Can be NULL.
163 //-------------------------------------------------------------------------
166 LPDIRECT3DDEVICE9 pDevice
,
168 LPD3DXBUFFER
* ppAdjacency
);
171 //-------------------------------------------------------------------------
174 // Creates a mesh containing the specified text using the font associated
175 // with the device context.
179 // pDevice The D3D device with which the mesh is going to be used.
180 // hDC Device context, with desired font selected
181 // pText Text to generate
182 // Deviation Maximum chordal deviation from true font outlines
183 // Extrusion Amount to extrude text in -Z direction
184 // ppMesh The mesh object which will be created
185 // pGlyphMetrics Address of buffer to receive glyph metric data (or NULL)
186 //-------------------------------------------------------------------------
189 LPDIRECT3DDEVICE9 pDevice
,
195 LPD3DXBUFFER
* ppAdjacency
,
196 LPGLYPHMETRICSFLOAT pGlyphMetrics
);
200 LPDIRECT3DDEVICE9 pDevice
,
206 LPD3DXBUFFER
* ppAdjacency
,
207 LPGLYPHMETRICSFLOAT pGlyphMetrics
);
210 #define D3DXCreateText D3DXCreateTextW
212 #define D3DXCreateText D3DXCreateTextA
220 #endif //__D3DX9SHAPES_H__