?/TD>
Microsoft DirectX 9.0

IDirect3DQuery9::GetData Method


Gets the query information.

Syntax

HRESULT GetData(      

    void* pData,     DWORD dwSize,     DWORD dwGetDataFlags );

Parameters

pData
[in, out] Pointer to a buffer containing the query data.
dwSize
[in] Number of bytes of data. See Remarks.
dwGetDataFlags
[in] Data flags specifying the query type. Valid values are either 0 or D3DGETDATA_FLUSH, which will force the runtime to flush the query down to the driver. See Remarks.

Return Value

The method returns S_OK if the query data is available and S_FALSE if it is not. These are considered successful return values.

If the method fails when D3DGETDATA_FLUSH is used, the return value can be D3DERR_DEVICELOST.



Remarks

The application is expected to pass the right amount of data for the query results. If the query result is available, the runtime returns the query data.

The size of dwSize depends on the query type given as follows:
Query TypeSize
D3DQUERYTYPE_VCACHEsizeof(D3DDEVINFO_VCACHE)
D3DQUERYTYPE_RESOURCEMANAGERsizeof(D3DDEVINFO_RESOURCEMANAGER)
D3DQUERYTYPE_VERTEXSTATSsizeof(D3DDEVINFO_D3DVERTEXSTATS)
D3DQUERYTYPE_EVENTsizeof(BOOL)
D3DQUERYTYPE_OCCLUSIONsizeof(DWORD)

Use D3DGETDATA_FLUSH to flush the internally batched queries to the driver. For applications writing their own version of waiting, results of queries from the driver are batched (not realized) until the driver receives a flush.

When D3DGETDATA_FLUSH is specified, this method can also return D3DERR_DEVICELOST in response to a device that is lost. This allows an application to prevent threads from polling forever due to a lost device (which cannot respond to the query).

See Also

D3DDEVINFO_VCACHE, D3DDEVINFO_RESOURCEMANAGER, D3DDEVINFO_D3DVERTEXSTATS


© 2002 Microsoft Corporation. All rights reserved.