Rendering with Texture Handles

After your program creates a texture handle and loads a bitmap onto the texture's surface, it may use the texture for rendering. Texture handles can be used to set the texture-related rendering states whether your application utilizes the DrawPrimitive methods or execute buffers. If it uses the DrawPrimitive methods, all rendering states are set by invoking the IDirect3DDevice3::SetRenderState method. Pass the texture-related rendering state as the first parameter. The second parameter must be the texture's handle.

When an application sets a texture as the current texture, Direct3D applies it to all primitives that it renders with the DrawPrimitive methods. For further information, see Current Texture.

Your application controls the mapping of texture coordinates to screen coordinates by setting the texture-addressing rendering state. See Texture Addressing State.

On some 3-D hardware, applications can also enable or disable perspective correction. Many 3-D cards apply texture perspective correction unconditionally. Direct3D perspective correction is enabled by default. See Texture Perspective State.

Direct3D sports a powerful set of texture filtering capabilities. For further information, see Texture Filtering and Texture Filtering State.

When it applies a texture to a primitive's surface, your application can blend the texture's texel colors with the current color of a primitive. It can only blend one texture at a time if it uses texture handles. See Texture Blending State.

Applications that render with execute buffers use texture handles. Invoke the IDirect3DDevice3::SetRenderState method and pass the D3DRENDERSTATE_TEXTUREHANDLE render state (part of the D3DRENDERSTATETYPE enumerated type) as the value of the first parameter. Set the texture handle as the second parameter.