Shader Class

SFML.Net

Shader Class
Wrapper for pixel shaders
Inheritance Hierarchy
SystemObject  SFMLObjectBase
    SFML.GraphicsShader

Namespace: SFML.Graphics
Assembly: sfmlnet-graphics-2 (in sfmlnet-graphics-2.dll) Version: 2.2.0.0 (2.2.0)
Syntax
public class Shader : ObjectBase
Public Class Shader
	Inherits ObjectBase
public ref class Shader : public ObjectBase
type Shader =  
    class
        inherit ObjectBase
    end

The Shader type exposes the following members.

Constructors
  NameDescription
Public methodShader(IntPtr)
Construct the shader from a pointer
Public methodShader(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.
Public methodShader(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.
Top
Methods
  NameDescription
Public methodStatic memberBind
Bind a shader for rendering
Protected methodDestroy
Handle the destruction of the object
(Overrides ObjectBaseDestroy(Boolean).)
Public methodDispose
Explicitely dispose the object
(Inherited from ObjectBase.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Dispose the object
(Inherited from ObjectBase.)
Public methodStatic memberFromString
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.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetParameter(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).
Public methodSetParameter(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).
Public methodSetParameter(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.
Public methodSetParameter(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).
Public methodSetParameter(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).
Public methodSetParameter(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).
Public methodSetParameter(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).
Public methodSetParameter(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).
Public methodSetParameter(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).
Public methodToString
Provide a string describing the object
(Overrides ObjectToString.)
Top
Fields
  NameDescription
Public fieldStatic memberCurrentTexture
Special value that can be passed to SetParameter, and that represents the texture of the object being drawn
Top
Properties
  NameDescription
Public propertyCPointer
Access to the internal pointer of the object. For internal use only
(Inherited from ObjectBase.)
Public propertyStatic memberIsAvailable
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.
Top
See Also