Beispiel #1
0
 public void Draw(GeometricPrimitives gp, int start, int count)
 {
     if (start < 0 || start + count > ElementCount)
     {
         throw new IndexOutOfRangeException();
     }
     Use(() => GL.DrawElements((PrimitiveType)gp, count, DrawElementsType.UnsignedInt, start));
 }
Beispiel #2
0
 public void Draw(GeometricPrimitives gp, int start, int count)
 {
     if (start < 0 || start + count > VertexCount)
     {
         throw new IndexOutOfRangeException();
     }
     Use(() => GL.DrawArrays((PrimitiveType)gp, start, count));
 }
Beispiel #3
0
        static VertexPositionTexture[] CreateQuadUv(Faces face)
        {
            var quad = GeometricPrimitives.GetQuad(face);
            var mesh = new VertexPositionTexture[quad.Length];

            for (var i = 0; i < quad.Length; i++)
            {
                mesh[i] = new VertexPositionTexture(quad[i], GeometricPrimitives.QuadUv[i]);
            }
            return(mesh);
        }
Beispiel #4
0
 public Model(GeometricPrimitives prim = GeometricPrimitives.Triangles) => _primitive = prim;
Beispiel #5
0
 public void Draw(GeometricPrimitives gp, int count)
 {
     Draw(gp, 0, count);
 }
Beispiel #6
0
 public void Draw(GeometricPrimitives gp)
 {
     Draw(gp, 0, ElementCount);
 }
Beispiel #7
0
 public void Draw(GeometricPrimitives gp)
 {
     Draw(gp, 0, VertexCount);
 }
Beispiel #8
0
 public Face(IVertexRenderer ic, GeometricPrimitives pr)
 {
     Indices   = ic ?? throw new ArgumentNullException(nameof(ic));
     Primitive = pr;
 }