Should this work?
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.
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
Popular Topics
Advertisement