D3DMXCreateTexture (Windows Embedded CE 6.0)

1/6/2010

This function creates an empty texture.

Syntax

HRESULT WINAPI D3DMXCreateTexture(
  LPDIRECT3DMOBILEDEVICE   pDevice,
  UINT                     Width,
  UINT                     Height,
  UINT                     MipLevels,
  DWORD                    Usage,
  D3DMFORMAT               Format,
  D3DMPOOL                 Pool,
  LPDIRECT3DMOBILETEXTURE* ppTexture
);

Parameters

  • pDevice
    [in] Pointer to an IDirect3DMobileDevice interface, representing the device to be associated with the texture.
  • Width
    [in] A UINT value that determines the width, in pixels, of the texture. This value must be nonzero. See Remarks for more information.
  • Height
    [in] A UINT value that determines the height, in pixels, of the texture. This value must be nonzero. See Remarks for more information.
  • MipLevels
    [in] A UINT value that identifies the number of mip levels requested. If this value is zero or D3DMX_DEFAULT, a complete mipmap chain is created.
  • Usage
    [in] A DWORD value that is either 0, D3DMUSAGE_RENDERTARGET, or D3DMUSAGE_DYNAMIC (see D3DMUSAGE Values). Setting this flag to D3DMUSAGE_RENDERTARGET indicates that the surface is to be used as a render target. The resource can then be passed to the pNewRenderTarget parameter of the IDirect3DMobileDevice::SetRenderTarget method. If either D3DMUSAGE_RENDERTARGET or D3DMUSAGE_DYNAMIC is specified, the application should check that the device supports this operation by calling IDirect3DMobile::CheckDeviceFormat.
  • Format
    [in] Member of the D3DMFORMAT enumerated type, describing the requested pixel format for the texture. The returned texture may be a different format from that specified, if the device does not support the requested format. Applications should check the format of the returned texture to see if it matches the format requested.
  • Pool
    [in] Member of the D3DMPOOL enumerated type, describing the memory class into which the texture should be placed.
  • ppTexture
    [out] Address of a pointer to an IDirect3DMobileTexture interface, representing the created texture object.

Return Value

If the function succeeds, the return value is D3D_OK (see D3DM Values).

If the function fails, the return value can be one of the following values.

Value Description

D3DMERR_NOTAVAILABLE

This device does not support the queried technique.

D3DMERR_OUTOFVIDEOMEMORY

Microsoft® Direct3D® Mobile does not have enough display memory to perform the operation.

D3DMERR_INVALIDCALL

The method call is invalid. For example, a method's parameter may have an invalid value.

E_OUTOFMEMORY

Direct3D Mobile could not allocate sufficient memory to complete the call.

Remarks

Internally, D3DMXCreateTexture uses D3DMXCheckTextureRequirements to adjust the calling parameters. Therefore, calls to D3DXCreateTexture will often succeed where calls to IDirect3DMobileDevice::CreateTexture would fail.

If both Height and Width are set to D3DMX_DEFAULT, a value of 256 is used for both parameters. If either Height or Width are set to D3DMX_DEFAULT and the other parameter is set to a numeric value, the texture is square, with the height and width of the texture equal to the numeric value.

Requirements

Header d3dmx.h
Library D3dmx.lib
Windows Embedded CE Windows Embedded CE 6.0 and later

See Also

Reference

D3DMX Functions
IDirect3DMobileDevice
D3DMUSAGE Values
IDirect3DMobileDevice::SetRenderTarget
IDirect3DMobile::CheckDeviceFormat
D3DMFORMAT
D3DMPOOL
IDirect3DMobileTexture
D3DM Values
D3DMXCheckTextureRequirements
IDirect3DMobileDevice::CreateTexture