SFML.Net
Shader Class |
Wrapper for pixel shaders

Namespace: SFML.Graphics
Assembly: sfmlnet-graphics-2 (in sfmlnet-graphics-2.dll) Version: 2.2.0.0 (2.2.0)

The Shader type exposes the following members.

Name | Description | |
---|---|---|
![]() | Shader(IntPtr) |
Construct the shader from a pointer
|
![]() | Shader(Stream, Stream) |
Load both the vertex and fragment shaders from custom streams
This function can load both the vertex and the fragment
shaders, or only one of them: pass NULL if you don't want to load
either the vertex shader or the fragment shader.
The sources must be valid shaders in GLSL language. GLSL is
a C-like language dedicated to OpenGL shaders; you'll
probably need to read a good documentation for it before
writing your own shaders.
|
![]() | Shader(String, String) |
Load the vertex and fragment shaders from files
This function can load both the vertex and the fragment
shaders, or only one of them: pass NULL if you don't want to load
either the vertex shader or the fragment shader.
The sources must be text files containing valid shaders
in GLSL language. GLSL is a C-like language dedicated to
OpenGL shaders; you'll probably need to read a good documentation
for it before writing your own shaders.
|

Name | Description | |
---|---|---|
![]() ![]() | Bind |
Bind a shader for rendering
|
![]() | Destroy |
Handle the destruction of the object
(Overrides ObjectBaseDestroy(Boolean).) |
![]() | Dispose |
Explicitely dispose the object
(Inherited from ObjectBase.) |
![]() | Equals |
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.) |
![]() | Finalize |
Dispose the object
(Inherited from ObjectBase.) |
![]() ![]() | FromString |
Load both the vertex and fragment shaders from source codes in memory
This function can load both the vertex and the fragment
shaders, or only one of them: pass NULL if you don't want to load
either the vertex shader or the fragment shader.
The sources must be valid shaders in GLSL language. GLSL is
a C-like language dedicated to OpenGL shaders; you'll
probably need to read a good documentation for it before
writing your own shaders.
|
![]() | GetHashCode |
Serves as a hash function for a particular type.
(Inherited from Object.) |
![]() | GetType |
Gets the Type of the current instance.
(Inherited from Object.) |
![]() | MemberwiseClone |
Creates a shallow copy of the current Object.
(Inherited from Object.) |
![]() | SetParameter(String, Color) |
Change a color parameter of the shader
"name" is the name of the variable to change in the shader.
The corresponding parameter in the shader must be a 4x1 vector
(vec4 GLSL type).
|
![]() | SetParameter(String, ShaderCurrentTextureType) |
Change a texture parameter of the shader
This overload maps a shader texture variable to the
texture of the object being drawn, which cannot be
known in advance. The second argument must be
sf::Shader::CurrentTexture.
The corresponding parameter in the shader must be a 2D texture
(sampler2D GLSL type).
|
![]() | SetParameter(String, Texture) |
Change a texture parameter of the shader
"name" is the name of the variable to change in the shader.
The corresponding parameter in the shader must be a 2D texture
(sampler2D GLSL type).
It is important to note that \a texture must remain alive as long
as the shader uses it, no copy is made internally.
To use the texture of the object being draw, which cannot be
known in advance, you can pass the special value
Shader.CurrentTexture.
|
![]() | SetParameter(String, Transform) |
Change a matrix parameter of the shader
"name" is the name of the variable to change in the shader.
The corresponding parameter in the shader must be a 4x4 matrix
(mat4 GLSL type).
|
![]() | SetParameter(String, Vector2f) |
Change a 2-components vector parameter of the shader
"name" is the name of the variable to change in the shader.
The corresponding parameter in the shader must be a 2x1 vector
(vec2 GLSL type).
|
![]() | SetParameter(String, Single) |
Change a float parameter of the shader
"name" is the name of the variable to change in the shader.
The corresponding parameter in the shader must be a float
(float GLSL type).
|
![]() | SetParameter(String, Single, Single) |
Change a 2-components vector parameter of the shader
"name" is the name of the variable to change in the shader.
The corresponding parameter in the shader must be a 2x1 vector
(vec2 GLSL type).
|
![]() | SetParameter(String, Single, Single, Single) |
Change a 3-components vector parameter of the shader
"name" is the name of the variable to change in the shader.
The corresponding parameter in the shader must be a 3x1 vector
(vec3 GLSL type).
|
![]() | SetParameter(String, Single, Single, Single, Single) |
Change a 4-components vector parameter of the shader
"name" is the name of the variable to change in the shader.
The corresponding parameter in the shader must be a 4x1 vector
(vec4 GLSL type).
|
![]() | ToString |
Provide a string describing the object
(Overrides ObjectToString.) |

Name | Description | |
---|---|---|
![]() ![]() | CurrentTexture |
Special value that can be passed to SetParameter,
and that represents the texture of the object being drawn
|

Name | Description | |
---|---|---|
![]() | CPointer |
Access to the internal pointer of the object.
For internal use only
(Inherited from ObjectBase.) |
![]() ![]() | IsAvailable |
Tell whether or not the system supports shaders.
This property should always be checked before using
the shader features. If it returns false, then
any attempt to use Shader will fail.
|
