Function
Determines whether an Array contains constant data, and, if so, returns both the number of items and in the array and the data value.
Syntax
#include <dx/dx.h>
Array DXQueryConstantArray (Array a, int *num, Pointer data)
Functional Details
DXQueryConstantArray determines if Array a contains constant data. If so, if num is not NULL, the number of items contained in a is returned in *num. If data is not NULL, the constant value contained in a will be copied to the block of memory pointed to by data. In this case data should point to a block of memory large enough to hold one element of a; this size can be determined by calling DXGetItemSize(a).
DXQueryConstantArray considers both Constant Array and Regular Array Objects with zero delta values to be constant.
The value stored in a may also be accessed by a call to DXGetConstantArrayData. This call returns a pointer to the internal memory of a, providing a read-only copy of the data without the need to allocate a block of memory.
Return Value
Returns a if a contains constant data or NULL (without setting an error code) if a is an Array that does not contain constant data; otherwise, returns NULL and sets an error code.
See Also
DXGetConstantArrayData, DXGetItemSize, DXNewConstantArray, DXNewConstantArrayV, DXNewRegularArray