Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    VertexDeclaration Class

    Namespace: Stride.Graphics
    Assembly: Stride.Graphics.dll

    The layout of a vertex buffer with a set of VertexElement.

    System.Object → VertexDeclaration
    Derived from VertexDeclaration:

    [DataContract]
    [DataSerializer(typeof(VertexDeclaration.Serializer))]
    public class VertexDeclaration : IEquatable<VertexDeclaration>
    Name Description
    Constructors
    VertexDeclaration(VertexElement[])

    Initializes a new instance of the VertexDeclaration class.

    VertexDeclaration(VertexElement[], Int32, Int32)

    Initializes a new instance of the VertexDeclaration class.

    Properties
    InstanceCount

    Gets the instance count.

    VertexElements

    Gets the vertex elements.

    VertexStride

    Gets the vertex stride.

    Methods
    CalculateSize()

    Calculate the size of the vertex declaration.

    EnumerateWithOffsets()

    Enumerates VertexElement with declared offsets.

    Equals(VertexDeclaration)
    Equals(Object)
    GetHashCode()
    Operators
    Implicit(VertexElement to VertexDeclaration)

    Performs an implicit conversion from VertexElement to VertexDeclaration.

    Implicit(VertexElement[] to VertexDeclaration)

    Performs an implicit conversion from VertexElement to VertexDeclaration.

    | Improve this Doc View Source

    Constructors


    VertexDeclaration(VertexElement[])

    Initializes a new instance of the VertexDeclaration class.

    public VertexDeclaration(params VertexElement[] elements)
    Parameters
    Type Name Description
    VertexElement[] elements

    The elements.


    VertexDeclaration(VertexElement[], Int32, Int32)

    Initializes a new instance of the VertexDeclaration class.

    public VertexDeclaration(VertexElement[] elements, int instanceCount, int vertexStride)
    Parameters
    Type Name Description
    VertexElement[] elements

    The elements.

    System.Int32 instanceCount

    The instance count.

    System.Int32 vertexStride

    The vertex stride.

    Exceptions
    Type Condition
    System.ArgumentNullException

    elements

    | Improve this Doc View Source

    Properties


    InstanceCount

    Gets the instance count.

    public int InstanceCount { get; }
    Property Value
    Type Description
    System.Int32

    The instance count.


    VertexElements

    Gets the vertex elements.

    public VertexElement[] VertexElements { get; }
    Property Value
    Type Description
    VertexElement[]

    The vertex elements.


    VertexStride

    Gets the vertex stride.

    public int VertexStride { get; }
    Property Value
    Type Description
    System.Int32

    The vertex stride.

    | Improve this Doc View Source

    Methods


    CalculateSize()

    Calculate the size of the vertex declaration.

    public int CalculateSize()
    Returns
    Type Description
    System.Int32

    The size in bytes of the vertex declaration


    EnumerateWithOffsets()

    Enumerates VertexElement with declared offsets.

    public IEnumerable<VertexElementWithOffset> EnumerateWithOffsets()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<VertexElementWithOffset>

    A set of VertexElement with offsets.


    Equals(VertexDeclaration)

    public bool Equals(VertexDeclaration other)
    Parameters
    Type Name Description
    VertexDeclaration other
    Returns
    Type Description
    System.Boolean

    Equals(Object)

    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)

    GetHashCode()

    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()
    | Improve this Doc View Source

    Operators


    Implicit(VertexElement to VertexDeclaration)

    Performs an implicit conversion from VertexElement to VertexDeclaration.

    public static implicit operator VertexDeclaration(VertexElement element)
    Parameters
    Type Name Description
    VertexElement element

    The element.

    Returns
    Type Description
    VertexDeclaration

    The result of the conversion.


    Implicit(VertexElement[] to VertexDeclaration)

    Performs an implicit conversion from VertexElement to VertexDeclaration.

    public static implicit operator VertexDeclaration(VertexElement[] elements)
    Parameters
    Type Name Description
    VertexElement[] elements

    The elements.

    Returns
    Type Description
    VertexDeclaration

    The result of the conversion.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    VertexBufferBindingExtensions.CreateInputElements(VertexDeclaration)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation