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

All texture maps in Microsoft® Direct3D® Mobile are treated as mipmaps. With this approach a regular texture maps is just mipmap with a single level.

You can create a texture map using the IDirect3DMobileDevice::CreateTexturemethod. This method allows you to specify the height and width of the top level of the mipmap, the number of levels in the map, the format of the memory pool, and the texture map's resource usage flags.

The maximum number of levels in a mipmap are influenced by the height and width of its top level. Direct3D Mobile creates levels such that each succeeding level is half the dimensions of the previous level, down to a minimum of 1 pixel in each direction, and an absolute minimum of 1x1. This implies that if you request a texture with a top level of 16 by 16, and 7 mipmap levels, you will get a map with levels of 16x16, 8x8, 4x4, 2x2, and 1x1. The middleware uses the minimum of the possible number of levels and the given maximum level count.

Setting the number of mipmap levels to 0 signals to the Direct3D Mobile middleware that it should automatically create the correct number of levels based on the top level map sized down to 1x1. This does not cause any filtering, it only creates the levels.

Display drivers may disallow the creation of textures that are not square as well as dimensions that are not a power of two. The driver may also set the largest possible dimensions and the most possible levels in a mipmap. A driver can disable mipmaps altogether by setting the maximum number of levels to 1 via its capability bits.

The Direct3D Mobile middleware will return an IDirect3DMobileTextureinterface if the call is successful. Use the IDirect3DMobileTexture::GetSurfaceLevelmethod to get IDirect3DMobileSurfaceinterfaces to the individual levels of the mipmap. Use the IDirect3DMobileTexture::LockRectmethod to lock levels of the texture map.

Use the IDirect3DMobileTextureinterface to identify the texture map when binding the map to a texture stage.

See Also