# [.net] device.Lights[0].Commit()??

## Recommended Posts

danne89    133
Hi! I'm reading in my new bought copy of Tom Miller's book and I have already got into a problem with the light section of the book's first chapter. The code for setting up a light is, according to the book, something like this:
device.Lights[0].Type = LightType.Point;
device.Lights[0].Position = new Vector3();
device.Lights[0].Diffuse = System.Drawing.Color.White;
device.Lights[0].Attenuation0 = 0.2f;
device.Lights[0].Range = 10000.0f;
device.Lights[0].Commit(); // Commit doesn't exist!
device.Lights[0].Enabled = true;

The problem is that Light.Commit() doesn't exist! // Daniel Lännström

##### Share on other sites
Oluseyi    2103
[Edit: Post edited for conciseness.]

Quote:
 From Introducing DirectX 9.0:The Commit method was removed from the Light class. Existing code relying on Light.Commit should be modified. Now, changes made to a Light object's properties do not take effect until Light.Update is called, or Light.Enabled is set to true.

danne89    133
Hmm, ok. Thanks!