D3DXFillCubeTexture

Uses a user-provided function to fill each texel of each mip level of a given cube texture.

HRESULT D3DXFillCubeTexture(
  LPDIRECT3DCUBETEXTURE9 pTexture,
  LPD3DXFILL3D pFunction,
  LPVOID pData
);

Parameters

pTexture
[out, retval] Pointer to an IDirect3DCubeTexture9 interface, representing the filled texture.
pFunction
[in] Pointer to a user-provided evaluator function, which will be used to compute the value of each texel. The function follows the prototype of LPD3DXFILL3D.
pData
[in] Pointer to an arbitrary block of user-defined data. This pointer will be passed to the function provided in pFunction.

Return Values

If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following values: D3DERR_INVALIDCALL.

Remarks

Here is an example that creates a function called ColorCubeFill, which relies on D3DXFillCubeTexture.

// Define a function that matches the prototype of LPD3DXFILL3D
VOID WINAPI ColorCubeFill (D3DXVECTOR4* pOut, const D3DXVECTOR3* pTexCoord, 
const D3DXVECTOR3* pTexelSize, LPVOID pData)
{
    *pOut = D3DXVECTOR4(pTexCoord->x, pTexCoord->y, pTexCoord->z, 0.0f);
}
    
    
// Fill the texture using D3DXFillCubeTexture
if (FAILED (hr = D3DXFillCubeTexture (m_pTexture, ColorCubeFill, NULL)))
{
    return hr;
}

Requirements

Header: Declared in D3dx9tex.h.