Sign in to follow this  

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this