Microsoft DirectX 8.0 (C++)

Creating Cubic-Environment Map Surfaces

You create a cubic environment map texture by calling the IDirect3DDevice8::CreateCubeTexture method. Cubic-environment map textures must be square, with dimensions that are a power of two.

The following code example shows how your C++ application might create a simple cubic-environment map.

/*
 * For this example, m_d3dDevice is a valid
 * pointer to an IDirect3DDevice8 interface.
 */

LPDIRECT3DCUBETEXTURE8 m_pCubeMap;

m_d3dDevice->CreateCubeTexture( 256, 1, D3DUSAGE_RENDERTARGET, D3DFMT_R8G8B8,
                                D3DPOOL_MANAGED, &m_pCubeMap );