Jump to content
  • Advertisement
Sign in to follow this  

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

This topic is 5406 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
[Edit: Post edited for conciseness.]

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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!