Microsoft DirectX 8.0 (Visual Basic) |
Creates a cube texture resource.
object.CreateCubeTexture( _ EdgeLength As Long, _ Levels As Long, _ Usage As Long, _ Format As CONST_D3DFORMAT, _ Pool As CONST_D3DPOOL) As Direct3DCubeTexture8
If either D3DUSAGE_RENDERTARGET or D3DUSAGE_DEPTHSTENCIL is specified, the application should check that the device supports these operations by calling Direct3D8.CheckDeviceFormat.
A Direct3DCubeTexture8 object, representing the created cube texture resource.
If the method fails, an error is raised and Err.Number can be set to one of the following values.
D3DERR_INVALIDCALL |
D3DERR_OUTOFVIDEOMEMORY |
E_OUTOFMEMORY |
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
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.
A texture (mipmap) is a collection of successively downsampled (mipmapped) surfaces. On the other hand, a cube texture (created by CreateCubeTexture) is a collection of six textures (mipmaps), one for each face. All faces must be present in the cube texture. Also, a cube map surface must be the same pixel size in all three dimensions (x, y, and z).
In DirectX 8.0, resource usage is enforced. An application that wishes to use a resource in a certain operation must specify that operation at resource creation time.