Microsoft DirectX 8.1 (Visual Basic)

D3DX8.CreateCubeTextureFromFileInMemory

Creates a cube texture from a file in memory.

object.CreateCubeTextureFromFileInMemory( _ 
    Device As Direct3DDevice8, _ 
    SrcData As Any, _ 
    LengthInBytes As Long) As Direct3DCubeTexture8

Parameters

object
Object expression that resolves to a D3DX8 object.
Device
Direct3DDevice8 object representing the device to be associated with the cube texture.
SrcData
File in memory from which to create the cube texture. See Remarks.
LengthInBytes
Size of the file in memory, in bytes.

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
D3DERR_OUTOFVIDEOMEMORY
D3DXERR_INVALIDDATA
E_OUTOFMEMORY

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

Remarks

Note that a resource created with this function will be placed in the memory class denoted by the D3DPOOL_MANAGED member of the CONST_D3DPOOL enumerated type.

This method is designed to be used for loading image files stored as RT_RCDATA, which is an application-defined resource (raw data). Otherwise this method fails.

CreateCubeTextureFromFileInMemory uses the DirectDrawSurface (DDS) file format. The DXTex Tool enables you to generate a cube map from other file formats and save it in the DDS file format.