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
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
The Shader type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Shader | Initializes a new instance of the Shader class |
Methods
Name | Description | |
---|---|---|
ApplyFogSettings | ||
ApplyShaderParameters | ||
Bind | ||
BindVertexDeclaration | ||
CreateDefault | (Inherited from ContentData.) | |
CreateShader | ||
Dispose | (Inherited from ContentData.) | |
DisposeData | (Inherited from ContentData.) | |
Equals(Object) | (Overrides Object Equals(Object).) | |
Equals(Shader) | ||
FillShaderCode | ||
GetHashCode | (Overrides Object GetHashCode .) | |
InternalCreateDefault | (Inherited from ContentData.) | |
LoadData | (Overrides ContentData LoadData(Stream).) | |
SetDiffuseTexture | ||
SetJointMatrices | ||
SetLightmapTexture | ||
SetModelViewProjection(Matrix) | ||
SetModelViewProjection(Matrix, Matrix, Matrix) | ||
SetSunLight | ||
ToString | (Inherited from ContentData.) | |
TryCreateShader |
Fields
Name | Description | |
---|---|---|
ContentChanged | (Inherited from ContentData.) |
Properties
Name | Description | |
---|---|---|
AllowCreationIfContentNotFound | (Inherited from ContentData.) | |
Data | ||
Flags | ||
IsDisposed | (Inherited from ContentData.) | |
MetaData | (Inherited from ContentData.) | |
Name | (Inherited from ContentData.) |
Remarks
Examples
[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