public Program() { this.id = string.Empty; this.vertexShader = null; this.fragmentShader = null; this.geometryShader = null; }
private static void read_geometry_shader(GeometryShader geometryShader, XElement element) { foreach (XAttribute a in element.Attributes()) { if (a.Name == "inputTopology") { switch (a.Value) { case "points": geometryShader.InputTopology = Topology.Points; break; case "lines": geometryShader.InputTopology = Topology.Lines; break; case "triangle": geometryShader.InputTopology = Topology.Triangles; break; default: geometryShader.InputTopology = Topology.Triangles; break; } } if (a.Name == "outputTopology") { switch (a.Value) { case "points": geometryShader.OutputTopology = Topology.Points; break; case "lines": geometryShader.OutputTopology = Topology.Lines; break; case "triangle": geometryShader.OutputTopology = Topology.Triangles; break; default: geometryShader.OutputTopology = Topology.Triangles; break; } } if (a.Name == "outputVertexCount") { int result = 0; int.TryParse(a.Value, out result); geometryShader.OutputVertexCount = result; } } foreach (XElement e in element.Elements()) { if (e.Name == "include") { Include include = new Include(); read_include(include, e); geometryShader.Includes.Add(include); } } }
private static void read_geometry_shader (GeometryShader geometryShader, XElement element) { foreach (XAttribute a in element.Attributes()) { if (a.Name == "inputTopology") { switch (a.Value) { case "points": geometryShader.InputTopology = Topology.Points; break; case "lines": geometryShader.InputTopology = Topology.Lines; break; case "triangle": geometryShader.InputTopology = Topology.Triangles; break; default: geometryShader.InputTopology = Topology.Triangles; break; } } if (a.Name == "outputTopology") { switch (a.Value) { case "points": geometryShader.OutputTopology = Topology.Points; break; case "lines": geometryShader.OutputTopology = Topology.Lines; break; case "triangle": geometryShader.OutputTopology = Topology.Triangles; break; default: geometryShader.OutputTopology = Topology.Triangles; break; } } if (a.Name == "outputVertexCount") { int result = 0; int.TryParse(a.Value, out result); geometryShader.OutputVertexCount = result; } } foreach (XElement e in element.Elements()) { if (e.Name == "include") { Include include = new Include(); read_include(include, e); geometryShader.Includes.Add(include); } } }