Material.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. namespace BansheeEngine
  4. {
  5. /** @addtogroup Rendering
  6. * @{
  7. */
  8. public partial class Material
  9. {
  10. /// <summary>
  11. /// Returns a texture assigned to the material.
  12. /// </summary>
  13. /// <param name="name">Name of the texture parameter.</param>
  14. /// <returns>Texture assigned to the specified material</returns>
  15. public RRef<Texture> GetTexture(string name)
  16. {
  17. return Internal_getTexture(mCachedPtr, name);
  18. }
  19. /// <summary>
  20. /// Assigns a texture to the specified material parameter. Allows you to specify a surface parameter that allows you
  21. /// to bind only a sub-set of the texture.
  22. /// </summary>
  23. /// <param name="name">Name of the texture parameter.</param>
  24. /// <param name="texture">Texture resource to assign.</param>
  25. /// <param name="surface">Subset of the texture to assign.</param>
  26. public void SetTexture(string name, RRef<Texture> texture, TextureSurface surface)
  27. {
  28. Internal_setTexture(mCachedPtr, name, texture, surface.mipLevel, surface.numMipLevels, surface.face,
  29. surface.numFaces);
  30. }
  31. /// <summary>
  32. /// Assigns a texture to the specified material parameter.
  33. /// </summary>
  34. /// <param name="name">Name of the texture parameter.</param>
  35. /// <param name="texture">Texture resource to assign.</param>
  36. public void SetTexture(string name, RRef<Texture> texture)
  37. {
  38. Internal_setTexture(mCachedPtr, name, texture, 0, 0, 0, 0);
  39. }
  40. }
  41. /** @} */
  42. }