IndexTypeConverter.cs 609 B

123456789101112131415161718192021
  1. using OpenTK.Graphics.OpenGL;
  2. using Ryujinx.Graphics.GAL;
  3. using System;
  4. namespace Ryujinx.Graphics.OpenGL
  5. {
  6. static class IndexTypeConverter
  7. {
  8. public static DrawElementsType Convert(this IndexType type)
  9. {
  10. switch (type)
  11. {
  12. case IndexType.UByte: return DrawElementsType.UnsignedByte;
  13. case IndexType.UShort: return DrawElementsType.UnsignedShort;
  14. case IndexType.UInt: return DrawElementsType.UnsignedInt;
  15. }
  16. throw new ArgumentException($"Invalid index type \"{type}\".");
  17. }
  18. }
  19. }