Microsoft DirectX 8.0 (Visual Basic)

Creating Cubic-Environment Map Surfaces

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

The following code shows how your Microsoft® Visual Basic® application might create a simple cubic-environment map.

'
' For this example, d3dDevice is a valid Direct3DDevice8 
' object and g_D3DX is a valid D3DX object.
'
Dim CubeMap As Direct3DCubeTexture8 CubeTexture

Set CubeMap = g_D3DX.CreateCubeTexture( d3dDevice, 256, 1, D3DUSAGE_RENDERTARGET, _
                                        D3DFMT_R8G8B8, D3DPOOL_MANAGED );