IDirect3DMobileDevice::LightEnable (Windows CE 5.0)

Send Feedback

This method enables or disables a set of lighting parameters within a device.

HRESULT LightEnable(  DWORD Index,  BOOL Enable);


  • Index
    [in] A DWORD value containing the light index for the light to be turned on or off.

    Setting this parameter to a light index that has not yet been used causes the Direct3D Mobile middleware to create a point light located at (0, 0, 0) with all color parameters set to 0xFFFFFFFF (white).

  • Enable
    [in] A BOOL value that specifies whether the light should be turned on or turned off. Set this value to TRUE to turn the light on or FALSE to turn the light off.

Return Values

If the method succeeds, the return value is D3DM_OK (see D3DM Values).

If the method fails, the return value can be D3DMERR_INVALIDCALL (see D3DMERR Values).


If a value for Index is outside the range of the light property sets assigned within the device, the IDirect3DMobileDevice::LightEnable method creates a light source represented by a D3DMLIGHT structure with the following properties and sets its enabled state to the value specified in Enable.

Member Default
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
Attenuation0 0
Attenuation1 0
Attenuation2 0


OS Versions: Windows CE 5.0 and later.
Header: D3dm.h.
Link Library: D3dm.lib, D3dmguid.lib.

See Also

IDirect3DMobileDevice | D3DMLIGHT

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.