Class SamplerState
A graphics object that describes a Sampler State, which determines how to sample Texture data.
public class SamplerState : GraphicsResourceBase, IDisposable, IComponent, IReferencable, ICollectorHolder
- Inheritance
-
objectSamplerState
- Implements
- Inherited Members
- Extension Methods
Fields
Description
The description of the Sampler State.
public readonly SamplerStateDescription Description
Field Value
Methods
Destroy()
Disposes the resources associated with the Graphics Resource, removes itself from the GraphicsDevice's resource registry, and transitions to the Destroyed state.
protected override void Destroy()
New(GraphicsDevice, ref readonly SamplerStateDescription, string?)
Creates a new SamplerState.
public static SamplerState New(GraphicsDevice device, ref readonly SamplerStateDescription description, string? name = null)
Parameters
deviceGraphicsDeviceThe GraphicsDevice.
descriptionSamplerStateDescriptionA SamplerStateDescription structure describing the Sampler State object to create.
namestringAn optional name that can be used to identify the Sampler State.
Returns
- SamplerState
A new Sampler State object.
NewFake(SamplerStateDescription)
Creates a new fake SamplerState for serialization.
public static SamplerState NewFake(SamplerStateDescription description)
Parameters
descriptionSamplerStateDescriptionA SamplerStateDescription structure describing the Sampler State object to create.
Returns
- SamplerState
A new fake Sampler State object.
OnDestroyed(bool)
Called when the GraphicsDevice has been detected to be internally destroyed, or when the Destroy() methad has been called. Raises the Destroyed event.
protected override void OnDestroyed(bool immediately = false)
Parameters
immediatelyboolA value indicating whether the resource should be destroyed immediately (true), or if it can be deferred until it's safe to do so (false).
Remarks
This method releases the underlying native resources (Silk.NET.Direct3D11.ID3D11Resource and Silk.NET.Direct3D11.ID3D11DeviceChild).
OnRecreate()
Called when the GraphicsDevice has been recreated.
protected override bool OnRecreate()