DirectX SDK

Immediate Mode Changes for DirectX 7.0

[Visual Basic]
Support for Visual Basic applications
Like the other components in DirectX 7.0, Direct3D Immediate Mode now offers its services to Visual Basic applications. This is made possible by a set of classes that marshal data from the Visual Basic application to the DirectX run time. In addition, the documentation provided with this SDK has been expanded to include the Visual Basic developer.
[C++]

DirectX 7.0 maintains backward compatibility by exposing and supporting objects and interfaces offered by previous releases of DirectX. However, two key Direct3D interfaces have been added as part of DirectX 7.0: IDirect3D7 and IDirect3DDevice7. They are interfaces to new objects that are distinct from those in previous releases. These new objects provide several new features, performance improvements, and ease-of-use enhancements over their counterparts from previous versions of DirectX:

Hardware-accelerated transformation and lighting
Direct3D can now take advantage of 3-D accelerators to accelerate transformation and lighting operations in hardware. If compliant hardware is available, the IDirect3D7::EnumDevices method sets the D3DDEVCAPS_HWTRANSFORMANDLIGHT capability flag in the dwDevCaps member of the associated D3DDEVICEDESC7 structure. For more information, see TnLHAL Device.
Environment mapping with cubic environment maps
Direct3D and DirectDraw now support a special type of texture map used in environment mapping, called a cubic environment map. Cubic environment mapping involves the use of a six-sided texture that can contain images to be applied to objects in a scene. Cubic environment maps provide realistic environment mapping in your applications, are easy to use, and even allow you to implement dynamic environment mapping.
API Changes
Direct3D for DirectX 7.0 moves lighting, material, and viewport parameters into the device interface. Therefore, separate objects to handle these parameters are no longer needed, nor are their interfaces. Several methods have been included in the IDirect3DDevice7 interface to manipulate these parameters.

Vertex buffers can now be used with strided vertices, made possible by the addition of the IDirect3DVertexBuffer7::ProcessVerticesStrided method to the new IDirect3DVertexBuffer7 interface.

Geometry Blending
Applications that use the Direct3D geometry pipeline can take advantage of new support for geometry blending. Geometry blending can be used to perform "skinning" effects to increase the realism of segmented objects in a scene, especially characters. For more information, see Geometry Blending.
Device-state blocks
Applications that target the new IDirect3DDevice7 interface can take advantage of its support for programmable sets of state changes, called state blocks. State blocks make it possible for a Direct3D application to record common sequences of device state changes into a construct that has a unique identifier, or block handle. Applications can use the block handle to execute previously recorded state blocks in a single method call. Besides minimizing the calls required to change device states, state blocks enable devices to cache precompiled sets of state changes for optimal execution, often resulting in improved performance. For details, see State Blocks.
Improved texture management
The Direct3D texture manager has been expanded to allow applications to prioritize managed textures. Direct3D uses texture priorities to determine which textures to keep in memory, and which to remove.
Support for Visual Basic applications
Like the other components in DirectX 7.0, Direct3D Immediate Mode now offers its services to Visual Basic applications. This is made possible by a set of classes that marshal data from the Visual Basic application to the DirectX run time. In addition, the documentation provided with this SDK has been expanded to include the Visual Basic developer.
Enhanced software emulation
Direct3D has been optimized to use any special instructions supported by the CPU. Supported instruction sets include the AMD 3D-Now! instruction set on some AMD processors and the MMX instruction set supported by many Intel processors. Where available, Direct3D utilizes the 3D-Now! instruction set to accelerate transformation and lighting operations and the MMX instruction set to accelerate rasterization. Applications that use the Direct3D transformation and lighting pipeline with software devices automatically benefit from this feature.

Migrating to the new set of Direct3D objects comes at a small price. Despite the names of the interfaces that they support, these objects are separate from their counterparts in previous releases, and they do not support the same interfaces. You cannot use IUnknown::QueryInterface to retrieve a legacy interface from an object that supports the new interfaces, nor can you query for a new interface from a legacy object. Attempts to do so fail, returning E_NOINTERFACE.

Existing applications that use execute buffers for rendering cannot use the new objects unless they abandon the execute buffer architecture. Otherwise, they must use the legacy objects (which will continue to be supported). In fact, execute-buffer rendering is generally considered obsolete. Therefore, no information covering the use of execute buffers is included in this documentation. Documentation about execute-buffer rendering is still available in the legacy documentation that ships with this SDK and is available for download from http://www.microsoft.com/directx.