Ejemplo n.º 1
0
 public SortableRenderable(int zIndex, Handle <Texture> texture, int index, RenderableType type)
 {
     Key     = (long)zIndex << 32 | (long)texture.Value;
     Index   = index;
     Type    = type;
     Texture = texture;
 }
Ejemplo n.º 2
0
        public Renderable(Color color, IEnumerable <IPoint3F> points, RenderableType type)
        {
            float[] verts = ToVertices(points);

            if (verts.Length % 3 != 0)
            {
                throw new Exception("The vertices contain at least one incomplete Vector!");
            }

            this.Color = color;
            Vertices   = verts;
            Type       = type switch
            {
                RenderableType.Lines => PrimitiveType.Lines,
                RenderableType.Points => PrimitiveType.Points,
                RenderableType.Triangles => PrimitiveType.Triangles,
                _ => PrimitiveType.Points
            };
        }