1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-10 13:31:42 +00:00
Ryujinx/Ryujinx.Graphics.OpenGL/Converters/PrimitiveTopologyConverter.cs

34 lines
1.8 KiB
C#
Raw Normal View History

2019-10-13 07:02:07 +01:00
using OpenTK.Graphics.OpenGL;
using Ryujinx.Graphics.GAL;
using System;
namespace Ryujinx.Graphics.OpenGL
{
static class PrimitiveTopologyConverter
{
public static PrimitiveType Convert(this PrimitiveTopology topology)
{
switch (topology)
{
case PrimitiveTopology.Points: return PrimitiveType.Points;
case PrimitiveTopology.Lines: return PrimitiveType.Lines;
case PrimitiveTopology.LineLoop: return PrimitiveType.LineLoop;
case PrimitiveTopology.LineStrip: return PrimitiveType.LineStrip;
case PrimitiveTopology.Triangles: return PrimitiveType.Triangles;
case PrimitiveTopology.TriangleStrip: return PrimitiveType.TriangleStrip;
case PrimitiveTopology.TriangleFan: return PrimitiveType.TriangleFan;
case PrimitiveTopology.Quads: return PrimitiveType.Quads;
case PrimitiveTopology.QuadStrip: return PrimitiveType.QuadStrip;
case PrimitiveTopology.Polygon: return PrimitiveType.Polygon;
case PrimitiveTopology.LinesAdjacency: return PrimitiveType.LinesAdjacency;
case PrimitiveTopology.LineStripAdjacency: return PrimitiveType.LineStripAdjacency;
case PrimitiveTopology.TrianglesAdjacency: return PrimitiveType.TrianglesAdjacency;
case PrimitiveTopology.TriangleStripAdjacency: return PrimitiveType.TriangleStripAdjacency;
case PrimitiveTopology.Patches: return PrimitiveType.Patches;
}
throw new ArgumentException($"Invalid primitive topology \"{topology}\".");
}
}
}