Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/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 IDirect3DMobileDeviceinterface, 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 pNewRenderTargetparameter of the IDirect3DMobileDevice::SetRenderTargetmethod. 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 D3DMFORMATenumerated 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 D3DMPOOLenumerated type, describing the memory class into which the texture should be placed.

ppTexture

[out] Address of a pointer to an IDirect3DMobileTextureinterface, 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, D3DMXCreateTextureuses D3DMXCheckTextureRequirementsto adjust the calling parameters. Therefore, calls to D3DXCreateTexturewill often succeed where calls to IDirect3DMobileDevice::CreateTexturewould fail.

If both Heightand Widthare set to D3DMX_DEFAULT, a value of 256 is used for both parameters. If either Heightor Widthare 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
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later

See Also