• Advertisement
Sign in to follow this  

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

This topic is 4890 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 this post


Link to post
Share on other sites
Advertisement
[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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement