Shader ClassDelta Engine Documentation
Tells the GPU how to render 2D or 3D material data on screen. Usually loaded from content. This base class has no functionality, some common functionality can be found in ShaderWithFormat. Provide multiple framework specific shader codes if creating manually. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Content ContentData
    DeltaEngine.Content Shader
      DeltaEngine.Content.Tests MockImageTests MockShader
      DeltaEngine.Graphics ShaderWithFormat
      DeltaEngine.Tests.Content FakeShader

Namespace: DeltaEngine.Content
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public abstract class Shader : ContentData, 
	IEquatable<Shader>

The Shader type exposes the following members.

Constructors

  NameDescription
Protected methodShader
Initializes a new instance of the Shader class
Top
Methods

  NameDescription
Public methodApplyFogSettings
Public methodApplyShaderParameters
Public methodBind
Public methodBindVertexDeclaration
Protected methodCreateDefault (Inherited from ContentData.)
Protected methodCreateShader
Public methodDispose (Inherited from ContentData.)
Protected methodDisposeData (Inherited from ContentData.)
Public methodEquals(Object) (Overrides Object Equals(Object).)
Public methodEquals(Shader)
Protected methodFillShaderCode
Public methodGetHashCode (Overrides Object GetHashCode .)
Public methodInternalCreateDefault (Inherited from ContentData.)
Protected methodLoadData (Overrides ContentData LoadData(Stream).)
Public methodSetDiffuseTexture
Public methodSetJointMatrices
Public methodSetLightmapTexture
Public methodSetModelViewProjection(Matrix)
Public methodSetModelViewProjection(Matrix, Matrix, Matrix)
Public methodSetSunLight
Public methodToString (Inherited from ContentData.)
Protected methodTryCreateShader
Top
Fields

  NameDescription
Protected fieldContentChanged (Inherited from ContentData.)
Top
Properties

  NameDescription
Protected propertyAllowCreationIfContentNotFound (Inherited from ContentData.)
Protected propertyData
Public propertyFlags
Public propertyIsDisposed (Inherited from ContentData.)
Public propertyMetaData (Inherited from ContentData.)
Public propertyName (Inherited from ContentData.)
Top
Remarks

Tests: DeltaEngine.Tests.Content.ShaderTests
Examples

2 unit tests call DeltaEngine.Content.Shader
[Test]
public void ShadersAreEqualWhenTheFlagsAreTheSame()
{
    Shader coloredShader = CreateShaderByFlags(ShaderFlags.Colored);
    Assert.AreEqual(coloredShader, CreateShaderByFlags(ShaderFlags.Colored));
    Assert.AreNotEqual(coloredShader, CreateShaderByFlags(ShaderFlags.Textured));
}
[Test]
public void CompareShaderCreationDatas()
{
    var data1 = new ShaderCreationData(ShaderFlags.Colored);
    var data2 = new ShaderCreationData(ShaderFlags.Textured);
    var data3 = new ShaderCreationData(ShaderFlags.Textured);
    Assert.IsFalse(data1.Equals(data2));
    Assert.IsTrue(data2.Equals(data3));
    Assert.AreNotEqual(data1, data2);
    Assert.AreEqual(data2, data3);
}
See Also