Mipmapping in the Direct3D HAL and HEL

ID: Q169294


The information in this article applies to:


SUMMARY

The D3DMIP Direct3D Immediate Mode example application demonstrates how to create a mipmapped texture using a source and destination DirectDraw surface.

A mipmap is a sequence of textures, each of which is a representation of the same image at varying resolutions. The sequence of textures in a mipmap are progressively lower in resolution and each image in the mipmap is a power of two smaller than the previous level. The D3DMIP sample demonstrates how to create and use a mipmapped sequence of textures in the HEL and in the HAL.

The following file is available for download from the Microsoft Software Library:

~ D3dmip.exe
For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
Q119591 How to Obtain Microsoft Support Files from Online Services


MORE INFORMATION

D3DMIP shows how to create a mipmapped texture surface and mipmapped texture object from a series of three BMP files. There are three levels in the mipmap and, consequently, three DirectDraw surfaces in the complex surface are created for the mipmap. The creation of the mipmap is done in a two step process. A source texture surface is created in system memory and a source texture object is created by calling QueryInterface() on that surface. A second, initially empty, DirectDraw texture surface is created in video memory if 3D accelerated hardware was selected. If using the HEL, the second surface is created in system memory. A second texture object, the destination texture, is created based off of this surface. The source texture is loaded into the destination texture surface with a call to IDirect3DTexture::Load() and then discarded. This process allows a 3D accelerated device to compress a texture map as it enters video memory during the IDirect3DTexture::Load() call. The creation of textures must be done in this manner. For further example code on the creation of source and destination texture objects and texture surfaces, look at file "texture.c" in the "misc" directory of the DirectX SDK samples.

Additional query words:


Keywords          : kbfile kbsample KbDirectX300 kbSDKWin32 
Version           : WINDOWS:3.0
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: June 17, 1999