Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    Buffer.Constant Class

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

    Constant buffer helper methods.

    System.Object → Buffer.Constant
    Derived from Buffer.Constant:

    public static class Constant
    Name Description
    Methods
    New(GraphicsDevice, DataPointer, GraphicsResourceUsage)

    Creates a new constant buffer with Dynamic usage.

    New(GraphicsDevice, Int32, GraphicsResourceUsage)

    Creates a new constant buffer with a default Dynamic usage.

    New<T>(GraphicsDevice)

    Creates a new constant buffer with Dynamic usage.

    New<T>(GraphicsDevice, ref T, GraphicsResourceUsage)

    Creates a new constant buffer with Dynamic usage.

    New<T>(GraphicsDevice, T[], GraphicsResourceUsage)

    Creates a new constant buffer with Dynamic usage.

    | Improve this Doc View Source

    Methods


    New(GraphicsDevice, DataPointer, GraphicsResourceUsage)

    Creates a new constant buffer with Dynamic usage.

    public static Buffer New(GraphicsDevice device, DataPointer value, GraphicsResourceUsage usage = GraphicsResourceUsage.Dynamic)
    Parameters
    Type Name Description
    GraphicsDevice device

    The GraphicsDevice.

    DataPointer value

    The value to initialize the constant buffer.

    GraphicsResourceUsage usage

    The usage of this resource.

    Returns
    Type Description
    Buffer

    A constant buffer


    New(GraphicsDevice, Int32, GraphicsResourceUsage)

    Creates a new constant buffer with a default Dynamic usage.

    public static Buffer New(GraphicsDevice device, int size, GraphicsResourceUsage usage = GraphicsResourceUsage.Dynamic)
    Parameters
    Type Name Description
    GraphicsDevice device

    The GraphicsDevice.

    System.Int32 size

    The size in bytes.

    GraphicsResourceUsage usage

    The usage.

    Returns
    Type Description
    Buffer

    A constant buffer


    New<T>(GraphicsDevice)

    Creates a new constant buffer with Dynamic usage.

    public static Buffer<T> New<T>(GraphicsDevice device)
        where T : struct
    Parameters
    Type Name Description
    GraphicsDevice device

    The GraphicsDevice.

    Returns
    Type Description
    Buffer<T>

    A constant buffer

    Type Parameters
    Name Description
    T

    Type of the constant buffer to get the sizeof from


    New<T>(GraphicsDevice, ref T, GraphicsResourceUsage)

    Creates a new constant buffer with Dynamic usage.

    public static Buffer<T> New<T>(GraphicsDevice device, ref T value, GraphicsResourceUsage usage = GraphicsResourceUsage.Dynamic)
        where T : struct
    Parameters
    Type Name Description
    GraphicsDevice device

    The GraphicsDevice.

    T value

    The value to initialize the constant buffer.

    GraphicsResourceUsage usage

    The usage of this resource.

    Returns
    Type Description
    Buffer<T>

    A constant buffer

    Type Parameters
    Name Description
    T

    Type of the constant buffer to get the sizeof from


    New<T>(GraphicsDevice, T[], GraphicsResourceUsage)

    Creates a new constant buffer with Dynamic usage.

    public static Buffer<T> New<T>(GraphicsDevice device, T[] value, GraphicsResourceUsage usage = GraphicsResourceUsage.Dynamic)
        where T : struct
    Parameters
    Type Name Description
    GraphicsDevice device

    The GraphicsDevice.

    T[] value

    The value to initialize the constant buffer.

    GraphicsResourceUsage usage

    The usage of this resource.

    Returns
    Type Description
    Buffer<T>

    A constant buffer

    Type Parameters
    Name Description
    T

    Type of the constant buffer to get the sizeof from


    • Improve this Doc
    • View Source
    In This Article

    Back to top

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