IFontStashRenderer2.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #if MONOGAME || FNA
  2. using Microsoft.Xna.Framework.Graphics;
  3. #elif STRIDE
  4. using Stride.Core.Mathematics;
  5. using Stride.Graphics;
  6. using Texture2D = Stride.Graphics.Texture;
  7. #else
  8. using System.Numerics;
  9. using Texture2D = Veldrid.Texture;
  10. using System.Runtime.InteropServices;
  11. #endif
  12. namespace FontStashSharp.Interfaces
  13. {
  14. #if PLATFORM_AGNOSTIC
  15. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  16. public struct VertexPositionColorTexture
  17. {
  18. /// <summary>
  19. /// Position
  20. /// </summary>
  21. public Vector3 Position;
  22. /// <summary>
  23. /// Color
  24. /// </summary>
  25. public Veldrid.RgbaFloat Color;
  26. /// <summary>
  27. /// Texture Coordinate
  28. /// </summary>
  29. public Vector2 TextureCoordinate;
  30. }
  31. #endif
  32. public interface IFontStashRenderer2
  33. {
  34. #if MONOGAME || FNA || STRIDE
  35. GraphicsDevice GraphicsDevice { get; }
  36. #else
  37. ITexture2DManager TextureManager { get; }
  38. #endif
  39. void DrawQuad(Texture2D texture, ref VertexPositionColorTexture topLeft, ref VertexPositionColorTexture topRight, ref VertexPositionColorTexture bottomLeft, ref VertexPositionColorTexture bottomRight);
  40. }
  41. }