Adds graphics specific features to a shader object like VertexFormat and the shader code.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Content ContentData
DeltaEngine.Content Shader
DeltaEngine.Graphics ShaderWithFormat
DeltaEngine.Graphics.BaseOpenGL11 OpenGL11Shader
DeltaEngine.Graphics.BaseOpenGL20 OpenGL20Shader
DeltaEngine.Graphics.Mocks MockShader
DeltaEngine.Graphics.SharpDX SharpDXShader
DeltaEngine.Graphics.SlimDX SlimDXShader
DeltaEngine.Graphics.Xna XnaShader
Namespace: DeltaEngine.Graphics
Assembly: DeltaEngine.Graphics (in DeltaEngine.Graphics.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The ShaderWithFormat type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ShaderWithFormat(ShaderCreationData) | Initializes a new instance of the ShaderWithFormat class | |
ShaderWithFormat(ShaderWithFormatCreationData) | Initializes a new instance of the ShaderWithFormat class |
Methods
Name | Description | |
---|---|---|
ApplyFogSettings | (Inherited from Shader.) | |
ApplyShaderParameters | (Inherited from Shader.) | |
Bind | (Inherited from Shader.) | |
BindVertexDeclaration | (Inherited from Shader.) | |
CreateDefault | (Inherited from ContentData.) | |
CreateShader | (Inherited from Shader.) | |
Dispose | (Inherited from ContentData.) | |
DisposeData | (Inherited from ContentData.) | |
Equals(Object) | (Inherited from Shader.) | |
Equals(Shader) | (Inherited from Shader.) | |
FillShaderCode | (Overrides Shader FillShaderCode .) | |
GetHashCode | (Inherited from Shader.) | |
InternalCreateDefault | (Inherited from ContentData.) | |
LoadData | (Inherited from Shader.) | |
SetDiffuseTexture | (Inherited from Shader.) | |
SetJointMatrices | (Inherited from Shader.) | |
SetLightmapTexture | (Inherited from Shader.) | |
SetModelViewProjection(Matrix) | (Inherited from Shader.) | |
SetModelViewProjection(Matrix, Matrix, Matrix) | (Inherited from Shader.) | |
SetSunLight | (Inherited from Shader.) | |
ToString | (Inherited from ContentData.) | |
TryCreateShader | (Inherited from Shader.) |
Fields
Name | Description | |
---|---|---|
ContentChanged | (Inherited from ContentData.) |
Properties
Name | Description | |
---|---|---|
AllowCreationIfContentNotFound | (Inherited from ContentData.) | |
Data | (Inherited from Shader.) | |
DX11Code | ||
DX9Code | ||
Flags | (Inherited from Shader.) | |
Format | ||
IsDisposed | (Inherited from ContentData.) | |
MetaData | (Inherited from ContentData.) | |
Name | (Inherited from ContentData.) | |
OpenGLFragmentCode | ||
OpenGLVertexCode |
Remarks
Examples
[Test, CloseAfterFirstFrame] public void InvalidVertexFormat() { var invalidData = new ShaderWithFormatCreationData(ShaderFlags.None, "", "", "", "", null); Assert.Throws<ShaderWithFormat.InvalidVertexFormat>( () => ContentLoader.Create<Shader>(invalidData)); var emptyFormat = new ShaderWithFormatCreationData(ShaderFlags.None, "", "", "", "", new VertexFormat(new VertexElement[0])); Assert.Throws<ShaderWithFormat.InvalidVertexFormat>( () => ContentLoader.Create<Shader>(emptyFormat)); }
[Test, CloseAfterFirstFrame] public void InvalidVertexAndPixelCode() { var data = new ShaderWithFormatCreationData(ShaderFlags.None, "", "", "", "", VertexFormat.Position2DColor); Assert.Throws<ShaderWithFormat.NoShaderCodeSpecifiedForOpenGLAndDirectX>( () => ContentLoader.Create<Shader>(data)); }
[Test, CloseAfterFirstFrame] public void AllowDynamicCreationViaCreationData() { var data = new ShaderWithFormatCreationData(ShaderFlags.None, "AnyData", "AnyData", "AnyData", "AnyData", VertexFormat.Position2DColor); var shader = ContentLoader.Create<NoDataShaderWithFormat>(data); Assert.DoesNotThrow(() => shader.ReloadCreationData(data)); }
See Also