Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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

Syntax

HRESULT LightEnable(
  DWORD 
Index,
  BOOL 
Enable
);

Parameters

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 Value

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).

Remarks

If a value for Indexis outside the range of the light property sets assigned within the device, the IDirect3DMobileDevice::LightEnablemethod creates a light source represented by a D3DMLIGHTstructure with the following properties and sets its enabled state to the value specified in Enable.

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

Attenuation0

0

Attenuation1

0

Attenuation2

0

Requirements

Header d3dm.h
Library D3dm.lib, D3dmguid.lib
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also