Microsoft DirectX 8.0 (Visual Basic) |
You retrieve the material properties that the rendering device is currently using by calling the Direct3DDevice8.GetMaterial method for the device. Unlike the Direct3DDevice8.SetMaterial method, GetMaterial doesn't require preparation. The GetMaterial method accepts a variable of type D3DMATERIAL8, and fills it with information describing the current material properties before returning.
' For this example, the d3dDevice variable is assumed to ' contain a valid reference to a Direct3DDevice8 object. On Local Error Resume Next Dim mat As D3DMATERIAL8 Call d3dDevice.GetMaterial(mat) If Err.Number <> D3D_OK Then ' Code to handle the error goes here. End If