DirectX SDK

D3DXCreateTeapot

The D3DXCreateTeapot function creates a teapot.

HRESULT D3DXCreateTeapot(
  LPDIRECT3DDEVICE7 pDevice,
  DWORD numTexCoords,
  ID3DXSimpleShape** ppShape
);

Parameters

pDevice
A pointer to the IDirect3DDevice7 interface of the device.
numTexCoords
The number of texture coordinates desired in the output vertex-buffer. The default value is 1. D3DX_DEFAULT is a valid input for this parameter.
ppShape
The address of a pointer to the output vertex-buffer, an ID3DXSimpleShape interface.

Return Values

If the function succeeds, the return value is S_OK.

If the function fails, the return value may be one of the following values:

CLASS_E_NOAGGREGATION
D3DERR_INVALIDPRIMITIVETYPE
D3DERR_INVALIDRAMPTEXTURE
D3DERR_INVALIDVERTEXFORMAT
D3DERR_INVALIDVERTEXTYPE
D3DERR_VBUF_CREATE_FAILED
D3DXERR_INVALIDPARAMETER
D3DXERR_NOMEMORY
D3DXERR_NULLPOINTER
DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS
DDERR_OUTOFMEMORY
DDERR_WASSTILLDRAWING

Remarks

This function returns a vertex buffer that can be used later for drawing or manipulation by the application.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Version: Requires DirectX 7.0.
  Header: Declared in d3dxshapes.h.
  Library: Use d3dx.lib.

See Also

D3DXCreateBox, D3DXCreateCylinder, D3DXCreatePolygon, D3DXCreateSphere, D3DXCreateTorus