PageRenderTime 82ms CodeModel.GetById 41ms app.highlight 1ms RepoModel.GetById 39ms app.codeStats 0ms

/Rendering/Basics/Materials/Material.cs

#
C# | 52 lines | 23 code | 3 blank | 26 comment | 0 complexity | 5e2bdd39fcc80dca06eddbfe10c3a1bd MD5 | raw file
 1using System;
 2using Delta.ContentSystem.Rendering;
 3using Delta.Graphics.Basics;
 4
 5namespace Delta.Rendering.Basics.Materials
 6{
 7	/// <summary>
 8	/// Material class, just derived from the BaseMaterial class, which contains
 9	/// all the functionality for drawing and animations. Note: For 2D rendering
10	/// use Material2D, which does not share this class, but all the BaseMaterial
11	/// functionality.
12	/// </summary>
13	public class Material : BaseMaterial
14	{
15		#region Constructors
16		/// <summary>
17		/// Create material with just a diffuse map and a shader. Will check if
18		/// the diffuse map is an animation set and load all animated images
19		/// automatically (use StartAnimation to control it).
20		/// </summary>
21		/// <param name="setDiffuseMapName">Diffuse map name.</param>
22		/// <param name="setShader">Shader to use during rendering.</param>
23		public Material(string setDiffuseMapName, Shader setShader)
24			: base(setDiffuseMapName, setShader)
25		{
26		}
27
28		/// <summary>
29		/// Special constructor to allow creating a material just with a single
30		/// diffuse map image (e.g. created from RenderToTexture).
31		/// </summary>
32		/// <param name="setDiffuseMap">Diffuse texture to use.</param>
33		/// <param name="setShader">The shader to use.</param>
34		public Material(Texture setDiffuseMap, Shader setShader)
35			: base(setDiffuseMap, setShader)
36		{
37		}
38
39		/// <summary>
40		/// Create material from MaterialData, only used internally, for example
41		/// for loading Models from ModelData (they contain a list of MaterialData)
42		/// </summary>
43		/// <param name="setData">
44		/// The <see cref="MaterialData"/> to use during rendering.
45		/// </param>
46		public Material(MaterialData setData)
47			: base(setData)
48		{
49		}
50		#endregion
51	}
52}