DirectX SDK |
The IDirect3DDevice7::LightEnable method enables or disables a set of lighting parameters within a device.
HRESULT LightEnable( DWORD dwLightIndex, BOOL bEnable );
If the method succeeds, the return value is D3D_OK.
If the method fails, the return value is an error. For a complete list of Direct3D Immediate Mode error values and descriptions, see Return Values.
If you supply a value for dwLightIndex outside the range of the light property sets currently assigned within the device, the LightEnable method creates a light source with the following properties and sets its enabled state to the value specified in bEnable:
Member | Default |
---|---|
dltType | D3DLIGHT_DIRECTIONAL |
dcvDiffuse | (R:1, G:1, B:1, A:0) |
dcvSpecular | (R:0, G:0, B:0, A:0) |
dcvAmbient | (R:0, G:0, B:0, A:0) |
dvPosition | (0, 0, 0) |
dvDirection | (0, 0, 1) |
dvRange | 0 |
dvFalloff | 0 |
dvAttenuation0 | 0 |
dvAttenuation1 | 0 |
dvAttenuation2 | 0 |
dvTheta | 0 |
dvPhi | 0 |
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Version: Requires DirectX 7.0.
Header: Declared in d3d.h.
IDirect3DDevice7::GetLight, IDirect3DDevice7::GetLightEnable, IDirect3DDevice7::SetLight, Lighting and Materials