Platform SDK: DirectX

Direct3DDevice7.LightEnable

The Direct3DDevice7.LightEnable method enables or disables a set of lighting parameters within a device.

object.LightEnable( _ 
    LightIndex As Long, _ 
    bEnable As Boolean) 

Parameters

object
Object expression that resolves to a Direct3DDevice7 object.
LightIndex
Zero-based index of the set of lighting parameters that are the target of this method.
bEnable
Value indicating if the set of lighting parameters are being enabled or disabled. Set this parameter to nonzero to enable lighting with the parameters at the specified index or zero to disable it.

Error Codes

If the method fails, an error is raised and Err.Number is set to an error code. For a complete list of Direct3D Immediate Mode error values and descriptions, see Error Codes.

Remarks

If you supply a value for LightIndex 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 Enable:

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

See Also

Direct3DDevice7.GetLight, Direct3DDevice7.GetLightEnable, Direct3DDevice7.SetLight, Lighting and Materials