IDirect3DLight Interface

You can create an IDirect3DLight interface by calling the IDirect3D::CreateLight method. The following example demonstrates how to create an IDirect3DLight interface, and then it sets the light by calling the IDirect3DLight::SetLight method.

lpDirect3D->CreateLight(

lplpDirect3DLight, // Address of a new light

pUnkOuter); // NULL

lpDirect3DLight->SetLight(

lpLight); // Address of a D3DLIGHT structure

Light objects reside on the interface list and on a viewport list. You can use the IDirect3DLight interface to get and set lights.