CDXBnds Initialization Helper Functions

These CDXBnds helper functions are useful for initializing a data object to the bounds in a specified surface, mesh, or the Microsoft® Windows® SAFEARRAY data type, or for setting all minimum and maximum bound values to zero.

Member Functions

GetSafeArray Gets the value of the data object from the bounds in the specified SAFEARRAY.
InitFromSafeArray Sets the value of the data object to the bounds in the specified SAFEARRAY.
SetEmpty Sets all minimum and maximum bound values to zero.
SetToMeshBounds Sets the value of the data object to the bounds of the specified mesh.
SetToSurfaceBounds Sets the value of the data object to the bounds of the specified surface.

CDXBnds::GetSafeArray

CDXBnds Class

Gets the value of the data object to the bounds in the specified SAFEARRAY data type.

Syntax

HRESULT GetSafeArray(
	SAFEARRAY **ppsa
) const;

Parameters

ppsa
[in] Address of a pointer to the SAFEARRAY data type.

Return Value

Returns S_OK if the operation was successful, or E_INVALIDARG if the safe array object is invalid.

Remarks

SAFEARRAY is expected to be a one-dimensional, eight-element array. The array values, inherited from the DXBNDS structure, are MinX, MaxX, MinY, MaxY, MinZ, MaxZ, MinT and MaxT, in that order.

CDXBnds::InitFromSafeArray

CDXBnds Class

Sets the value of the data object to the bounds in the specified SAFEARRAY.

Syntax

HRESULT InitFromSafeArray(
	SAFEARRAY *psa
);

Parameters

psa
[in] Pointer to the SAFEARRAY data type.

Return Value

Returns S_OK if the operation was successful, or E_INVALIDARG if the safe array object is invalid.

Remarks

SAFEARRAY is expected to be a one-dimensional, eight-element array. The array values, inherited from the DXBNDS structure, are MinX, MaxX, MinY, MaxY, MinZ, MaxZ, MinT and MaxT, in that order.

CDXBnds::SetEmpty

CDXBnds Class

Sets all minimum and maximum bound values to zero.

Syntax

void SetEmpty(void);
 

Return Value

No return value.

CDXBnds::SetToMeshBounds

CDXBnds Class

Sets the value of the data object to the bounds of the specified mesh.

Syntax

 HRESULT SetToMeshBounds(
	IDirect3DRMMeshBuilder3 *pMesh
);

Parameters

pMesh
[in] Pointer to a Direct3D Retained Mode Direct3DRMMeshBuilder3 mesh object from which to get the bounds.

Return Value

See IDirect3DRMMeshBuilder3::GetBox in the Direct3D Retained Mode documentation for return codes.

CDXBnds::SetToSurfaceBounds

CDXBnds Class

Sets the value of the data object to the bounds of the specified surface.

Syntax

HRESULT SetToSurfaceBounds(
	IDXSurface *pDXSurface
);

Parameters

pDXSurface
[in] Pointer to a surface from which to get the bounds.

Return Value

See IDXSurface::GetBounds for return codes.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.