I'm working on a wrapper for DirectX9, and it's coming along nicely. My current objective is to construct a handler for lights. However, IDirect3DDevice9::SetLight( ) and IDirect3DDevice9::LightEnable( ) are confusing me. The first parameter of both methods don't make sense to me. As for MSDN, it simply isn't clear enough to be classed as a suitable solution.
Zero-based index of the set of lighting properties to set. If a set of lighting properties exists at this index, it is overwritten by the new properties specified in pLight. (sic)
In LightEnable(), lightIndex just indexes the light you want to work on. When you call LightEnable() to turn on or off a particular light, how could the function know which light you are referring to? The D3DLIGHT object itself is not passed into the function, the light is identified by the index, and a light is linked to an index when you create that light with SetLight()