Manipulating Resources (Windows CE 5.0)

Send Feedback

Your application manipulates resources in order to render a scene. First, the application creates texture resources by using the IDirect3DMobileDevice::CreateTexture method.

The texture objects returned by the IDirect3DMobileDevice::CreateTexture texture creation method are containers for surfaces or volumes; these containers are generically known as buffers. The buffers owned by the resource inherit the usages, format, and pool of the resource but have their own type. For more information, see Resource Properties.

The application gains access to the contained surfaces, for the purpose of loading artwork, by calling the IDirect3DMobileTexture::LockRect method. For details, see Locking Resources.

The lock method takes arguments denoting the contained surface — for example, the mipmap sublevel or cube face of the texture — and returns a pointer to the pixels. The typical application never uses a surface object directly.

In addition, the application creates geometry-oriented resources by using the following methods:

Your application locks and fills the buffer resources by calling the following methods:

If your application is allowing the Microsoft® Direct3D® Mobile middleware to manage these resources, then the resource creation process ends here. Otherwise, the application manages the promotion of system memory resources to device-accessible resources, where the hardware accelerator can use them, by calling the IDirect3DMobileDevice::UpdateTexture method.

To present images rendered from resources, the application also needs color and depth-stencil buffers. For typical applications, the color buffer is owned by the device's swap chain, which is a collection of back buffer surfaces, and is implicitly created with the device. Depth-stencil surfaces can be implicitly created, or explicitly created by using the IDirect3DMobileDevice::CreateDepthStencilSurface method. The application associates a device and its depth and color buffer with a call to IDirect3DMobileDevice::SetRenderTarget.

For details on presenting the final image, see Presenting a Scene.

See Also

Common Details for Direct3D Mobile Resources

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.