Microsoft DirectX 8.1 (Visual Basic) |
Microsoft® Direct3D® is implemented through COM objects and interfaces. Applications written in C++ access these interfaces and objects directly, whereas Microsoft Visual Basic® applications interact with a layer of code—visible as the Microsoft DirectX® for Visual Basic Classes—that marshals data from a Visual Basic application to the DirectX run time.
The Direct3D object is the first object that your application creates and the last object that your application releases. Functions for enumerating and retrieving capabilities of a Direct3D device are accessible through the Direct3D object. This enables applications to select devices without creating them.
When a Microsoft® Direct3D® application written in Microsoft Visual Basic® starts, it must obtain a reference to the Direct3D8 class to access Direct3D functionality.
The following code example shows how to use the DirectX8.Direct3DCreate method to retrieve a reference to the Direct3D class.
Dim g_DX As New DirectX8 Dim g_D3D As Direct3D8 Set g_D3D = g_DX.Direct3DCreate() If g_D3D Is Nothing Then Exit Function
To navigate from the Direct3DDevice object to the Direct3D object that created the device, use the Direct3DDevice8.GetDirect3D method.