LightsFixedCollection Class
Collapse the table of content
Expand the table of content

LightsFixedCollection Class

Defines a collection of lights. This class cannot be inherited.

Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in microsoft.windowsmobile.directx.dll)

public sealed class LightsFixedCollection
public final class LightsFixedCollection
public final class LightsFixedCollection
Not applicable.

This class accommodates fixed-point math operations.

The following code example shows how to use a LightsFixedCollection class.

// This code example is from the
// Direct3D Mobile Fixed Point Lighting Sample
// of the .NET Compact Framework Samples in the SDK.

// The FrameMove method is called once per frame,
// and is the entry point for animating the scene.

public void FrameMove()
    lightData = device.LightsFixed[2];
    // Rotate through the various light types
    if (((int)appTime % 20) < 10)
        device.LightsFixed[2].Type = LightType.Point;
        device.LightsFixed[2].Type = LightType.Directional;

    // Make sure the light type is supported by the device. If
    // VertexProcessingCaps.PositionAllLights is not set, the
    // device does not support point or spot lights, so change
    // light #2's type to a directional light.
        if (device.LightsFixed[2].Type == LightType.Point)
            device.LightsFixed[2].Type = LightType.Directional;

    // Values for the light position, direction, and color
    float x = (float)Math.Sin(appTime*2.000f);
    float y = (float)Math.Sin(appTime*2.246f);
    float z = (float)Math.Sin(appTime*2.640f);

    byte r = (byte)((0.5f + 0.5f * x) * 0xff);
    byte g = (byte)((0.5f + 0.5f * y) * 0xff);
    byte b = (byte)((0.5f + 0.5f * z) * 0xff);
    device.LightsFixed[2].DiffuseColor =
        g, b));
    device.LightsFixed[2].Range = 100.0f;

        case LightType.Point:
            device.LightsFixed[2].Position =
                new Vector3Fixed(4.5f * x, 4.5f * y, 4.5f * z);
            device.LightsFixed[2].Attenuation1  = 0.4f;
        case LightType.Directional:
            device.LightsFixed[2].Direction =
                new Vector3Fixed(x, y, z);


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Compact Framework

Supported in: 2.0

Community Additions

© 2016 Microsoft