Microsoft DirectX 8.0 (C++) |
Creates a cube texture from a file specified by an ANSI string.
D3DXCreateCubeTextureFromFile maps to either D3DXCreateCubeTextureFromFileA or D3DXCreateCubeTextureFromFileW, depending on the inclusion or exclusion of the #define UNICODE switch, see Remarks.
HRESULT D3DXCreateCubeTextureFromFileA( LPDIRECT3DDEVICE8 pDevice, LPCSTR pSrcFile, LPDIRECT3DCUBETEXTURE8* ppCubeTexture );
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 |
D3DERR_NOTAVAILABLE |
D3DERR_OUTOFVIDEOMEMORY |
D3DXERR_INVALIDDATA |
E_OUTOFMEMORY |
Include or exclude the #define UNICODE switch to specify whether your application expects Unicode or ANSI strings. The following code fragment shows how D3DXCreateCubeTextureFromFile is defined.
#ifdef UNICODE #define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileW #else #define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileA #endif
Note that a resource created with this function will be placed in the memory class denoted by D3DPOOL_MANAGED.
D3DXCreateCubeTextureFromFileA 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.
Header: Declared in D3dx8tex.h.