|
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using Microsoft.DirectX.Direct3D;
namespace MdxScene.Lights
{
public abstract class D3dLight
{
protected D3dLight()
{
Diffuse = Color.White;
Enabled = true;
}
public virtual void Render(Device d3dDevice)
{
if (0 > Index)
{
return;
}
lock (d3dDevice)
{
SetSpecificLightValues(d3dDevice);
d3dDevice.Lights[Index].Diffuse = Diffuse;
d3dDevice.Lights[Index].Ambient = Ambient;
d3dDevice.Lights[Index].Specular = Specular;
d3dDevice.Lights[Index].Enabled = Enabled;
}
}
#region properties
public int Index { get; set; }
public Color Diffuse { get; set; }
public Color Ambient { get; set; }
public Color Specular { get; set; }
public bool Enabled { get; set; }
#endregion
protected abstract void SetSpecificLightValues(Device d3dDevice);
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.