Advertisement

Should this work?

Started by February 24, 2000 11:47 PM
0 comments, last by Esap1 24 years, 6 months ago
Should this code work, also, can I call this jus once, like when Im Initing my DirectX stuff and loading objects and such, and finally, is there an easier way, THANKS IN ADVANCE light1.dltType = D3DLIGHT_POINT; light1.dvPosition = D3DVECTOR(0,0,-200); light1.dcvDiffuse.dvR = 0.5; light1.dcvDiffuse.dvG = 0.5; light1.dcvDiffuse.dvB = 0.0; light1.dcvDiffuse.dvA = 0.0; m_pD3DDev->SetLight(0, &light1);
Yes, you only need to make this call once. Unless you change the light.

No, there are no easier way. D3D needs all this information to do the lighting. The only way to make it easier would be to ommit some variables which won''t do you any good.

I do think you should set the other variables in the light structure though. Or at least clear them with memset or ZeroMemory. Otherwise you don''t know what settings you get for ambient and specular lighting.

This topic is closed to new replies.

Advertisement