PageRenderTime 44ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/Rendering/Basics/Materials/Material.cs

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