DirectX SDK |
Note The information in this topic applies only to applications written in C++. DirectX for Visual Basic does not directly expose COM interfaces to applications.
The functionality of Direct3D objects is accessed by C++ applications through the interfaces IDirect3D, IDirect3D2, IDirect3D3, and IDirect3D7. This section presents general information on all three of these interfaces, working backward from the IDirect3D7 interface introduced with DirectX 7.0 to the first interface, IDirect3D.
The IDirect3D7 interface supports many of the same features as the IDirect3D3 interface, enabling applications to create rendering devices and vertex buffers, as well as enumerating pixel formats. This interface adds the ability to create textures, rendering obsolete the need to query a DirectDraw surface for a texture interface.
A notable difference between IDirect3D7 and its ancestors is the absence of methods to create light, material, or viewport objects. This difference reflects the approach taken in the IDirect3DDevice7 interface to incorporate lighting, material, and viewport parameters as part of the device's internal data structures, rather than separate objects.
The IDirect3D7 object supports the features described in Immediate Mode Changes for DirectX 7.0.
Applications obtain a pointer to the IDirect3D7 interface by using the QueryInterface method of the new IDirectDraw7 interface. For details, see Accessing Direct3D.
One of the most important differences between IDirect3D2 and its predecessor, IDirect3D, is that IDirect3D2 implements an IDirect3D2::CreateDevice method. This method creates a Direct3D device that supports the DrawPrimitive methods. For more information about the devices created by the IDirect3D2::CreateDevice method, see Direct3D Devices.
Like the IDirect3D2 interface, the IDirect3D3 interface supports the DrawPrimitive style of Direct3D programming. In addition, the IDirect3D3 interface extends the functionality of DrawPrimitive-style programming by introducing the IDirect3DDevice3 interface. This interface introduced the concepts of flexible vertex formats, vertex buffers, and new texturing capabilities. For additional information, see Vertex Formats, Textures, Vertex Buffers and Rendering.
Applications obtain a pointer to the IDirect3D3 interface from a DirectDraw object, using the QueryInterface method.