|
我有一段设置灯光的代码如下:
D3DXVECTOR3 dir(1.0f, -0.0f, 0.25f);
D3DXCOLOR c = d3d::WHITE;
D3DLIGHT9 dirLight = d3d::InitDirectionalLight(&dir, &c);
//
// Set and Enable the light.
//
Device->SetLight(0, &dirLight);
Device->LightEnable(0, true);
//
// Set lighting related render states.
//
Device->SetRenderState(D3DRS_NORMALIZENORMALS, true);
Device->SetRenderState(D3DRS_SPECULARENABLE, false);
这段代码是龙书上直接复制过来的,但是在应用的时候会报错
说是WHITE和InitDirectionalLight不是D3D成员
但是在原版代码中运行没有错误,求教为何 |
|