Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.LightEnable

Enables or disables a set of lighting parameters within a device.

object.LightEnable( _ 
    Index As Long, _ 
    Enabled As Long)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
Index
Zero-based index of the set of lighting parameters that are the target of this method.
Enabled
Value that indicates if the set of lighting parameters are being enabled or disabled. Set this parameter 1 to enable lighting with the parameters at the specified index, or 0 to disable it.

Error Codes

If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

If you supply a value for Index outside the range of the light property sets assigned within the device, the LightEnable method creates a light source represented by a D3DLIGHT8 type with the following properties, and it sets its enabled state to the value specified in Enabled.

Member Default
Type D3DLIGHT_DIRECTIONAL
Diffuse (R:1, G:1, B:1, A:0)
Specular (R:0, G:0, B:0, A:0)
Ambient (R:0, G:0, B:0, A:0)
Position (0, 0, 0)
Direction (0, 0, 1)
Range 0
Falloff 0
Attenuation0 0
Attenuation1 0
Attenuation2 0
Theta 0
Phi 0

See Also

Direct3DDevice8.GetLight, Direct3DDevice8.GetLightEnable, Direct3DDevice8.SetLight