Ejemplo n.º 1
0
  void Fog::set(Video_DX9 &screen) const {
    const DWORD mode = type == FOG_EXP ? D3DFOG_EXP
      : type == FOG_EXP2 ? D3DFOG_EXP2
      : D3DFOG_LINEAR;

    screen.get_d3d_device()->SetRenderState(D3DRS_FOGTABLEMODE, mode);

    if(type == FOG_LINEAR) {
      screen.get_d3d_device()->SetRenderState(D3DRS_FOGSTART, *(DWORD *)(&start));
      screen.get_d3d_device()->SetRenderState(D3DRS_FOGEND, *(DWORD *)(&end));
    }
    else
      screen.get_d3d_device()->SetRenderState(D3DRS_FOGDENSITY, *(DWORD *)(&density));

    screen.get_d3d_device()->SetRenderState(D3DRS_FOGCOLOR, color.get_argb());
  }
Ejemplo n.º 2
0
 void Light::set(const DWORD &number, Video_DX9 &screen) const {
   screen.get_d3d_device()->SetLight(number, reinterpret_cast<const D3DLIGHT9 *>(this));
   screen.get_d3d_device()->LightEnable(number, TRUE);
 }