Buffer.Constant Class
Namespace: Stride.GraphicsAssembly: Stride.Graphics.dll
Constant buffer helper methods.
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. |
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 |