Class RenderShader
Represents a shader program that consists of a vertex shader and a fragment shader.
public class RenderShader : IShaderProgram, IGraphicsResource
- Inheritance
-
RenderShader
- Implements
- Derived
- Inherited Members
Constructors
RenderShader()
Default constructor for the ShaderProgram class.
public RenderShader()
RenderShader(Shader, Shader)
Initializes a new instance of the ShaderProgram class with the specified vertex and fragment shaders.
public RenderShader(Shader vertexShader, Shader fragmentShader)
Parameters
Properties
FragmentShader
Gets or sets the fragment shader associated with the program.
public Shader FragmentShader { get; set; }
Property Value
IsInitialized
Gets a value indicating whether the object has been initialized.
public bool IsInitialized { get; }
Property Value
ProgramID
Gets or sets the ID of the shader program.
public int ProgramID { get; set; }
Property Value
VertexShader
Gets or sets the vertex shader associated with the program.
public Shader VertexShader { get; set; }
Property Value
Methods
Dispose(IRenderDevice)
Releases the resources associated with this shader program using the specified render device.
public void Dispose(IRenderDevice renderer)
Parameters
rendererIRenderDeviceThe render device used to dispose of the shader program. Cannot be null.
Exceptions
- InvalidOperationException
Thrown if the shader program is not initialized.
FreeCPUResources()
Releases any CPU resources that are currently allocated by the component.
public void FreeCPUResources()
Remarks
Call this method when the component no longer needs to perform CPU-intensive operations to allow the system to reclaim resources. After calling this method, the component may not be able to perform certain operations until resources are reallocated.
Init(IRenderDevice)
Initializes the shader program using the specified render device.
public void Init(IRenderDevice renderer)
Parameters
rendererIRenderDeviceThe render device used to build and initialize the shader program. Cannot be null.
Exceptions
- InvalidOperationException
Thrown if the shader program has already been initialized.