Microsoft DirectX 8.1 (Visual Basic)

D3DX8.CreateCubeTexture

Creates an empty cube texture, adjusting the calling parameters as necessary.

object.CreateCubeTexture( _ 
    Device As Direct3DDevice8, _ 
    Size As Long, _ 
    MipLevels As Long, _ 
    Usage As Long, _ 
    Format As CONST_D3DFORMAT, _ 
    Pool As CONST_D3DPOOL) As Direct3DCubeTexture8

Parts

object
Object expression that resolves to a D3DX8 object.
Device
Direct3DDevice8 object representing the device to be associated with the cube texture.
Size
Width and height of the cube texture, in pixels. So, if the cube texture is an 8 pixel by 8 pixel cube, the value for this parameter should be 8. Note that this value must be nonzero.
MipLevels
Number of mip levels requested. If this value is zero or D3DX_DEFAULT as defined by the CONST_D3DXENUM enumeration, a complete mipmap chain is created.
Usage
0 or the D3DUSAGE_RENDERTARGET member of the CONST_D3DUSAGEFLAGS enumeration. Specifying D3DUSAGE_RENDERTARGET indicates that the surface is to be used as a render target. The resource can be passed to the NewRenderTarget parameter of the SetRenderTarget method. If D3DUSAGE_RENDERTARGET is specified, the application should check that the device supports this operation by calling Direct3D8.CheckDeviceFormat.
Format
Member of the CONST_D3DFORMAT enumeration, describing the requested pixel format for the cube texture. The returned cube texture might have a format different from that specified by Format. Applications should check the format of the returned cube texture.
Pool
Member of the CONST_D3DPOOL enumeration, describing the memory class into which the cube texture should be placed.

Return Values

Direct3DCubeTexture8 object representing the created cube texture.

Error Codes

If the method fails, an error is raised and Err.Number can be set to one of the following values.

D3DERR_INVALIDCALL
D3DERR_NOTAVAILABLE
D3DXERR_INVALIDDATA
D3DERR_OUTOFVIDEOMEMORY
E_OUTOFMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

Cube textures differ from other surfaces in that they are collections of surfaces. To call SetRenderTarget with a cube texture, you must select an individual face using Direct3DCubeTexture8.GetCubeMapSurface and pass the resulting surface to SetRenderTarget.

Internally, D3DX8.CreateCubeTexture uses D3DX8.CheckCubeTextureRequirements to adjust the calling parameters. Therefore, calls to D3DX8.CreateCubeTexture often succeed where calls to Direct3DDevice8.CreateCubeTexture fail.