Documentation of SFML 2.4.1

Warning: this page refers to an old version of SFML. Click here to switch to the latest version.
sf::Glsl Namespace Reference

Namespace with GLSL types. More...

Typedefs

typedef Vector2< float > Vec2
 2D float vector (vec2 in GLSL) More...
 
typedef Vector2< int > Ivec2
 2D int vector (ivec2 in GLSL) More...
 
typedef Vector2< bool > Bvec2
 2D bool vector (bvec2 in GLSL) More...
 
typedef Vector3< float > Vec3
 3D float vector (vec3 in GLSL) More...
 
typedef Vector3< int > Ivec3
 3D int vector (ivec3 in GLSL) More...
 
typedef Vector3< bool > Bvec3
 3D bool vector (bvec3 in GLSL) More...
 
typedef priv::Vector4< float > Vec4
 
typedef priv::Vector4< int > Ivec4
 
typedef priv::Vector4< bool > Bvec4
 
typedef priv::Matrix< 3, 3 > Mat3
 
typedef priv::Matrix< 4, 4 > Mat4
 

Detailed Description

Namespace with GLSL types.

The sf::Glsl namespace contains types that match their equivalents in GLSL, the OpenGL shading language. These types are exclusively used by the sf::Shader class.

Types that already exist in SFML, such as sf::Vector2<T> and sf::Vector3<T>, are reused as typedefs, so you can use the types in this namespace as well as the original ones. Others are newly defined, such as Glsl::Vec4 or Glsl::Mat3. Their actual type is an implementation detail and should not be used.

All vector types support a default constructor that initializes every component to zero, in addition to a constructor with one parameter for each component. The components are stored in member variables called x, y, z, and w.

All matrix types support a constructor with a float* parameter that points to a float array of the appropriate size (that is, 9 in a 3x3 matrix, 16 in a 4x4 matrix). Furthermore, they can be converted from sf::Transform objects.

See also
sf::Shader

Typedef Documentation

typedef Vector2<bool> sf::Glsl::Bvec2

2D bool vector (bvec2 in GLSL)

Definition at line 76 of file Glsl.hpp.

typedef Vector3<bool> sf::Glsl::Bvec3

3D bool vector (bvec3 in GLSL)

Definition at line 94 of file Glsl.hpp.

typedef Vector2<int> sf::Glsl::Ivec2

2D int vector (ivec2 in GLSL)

Definition at line 70 of file Glsl.hpp.

typedef Vector3<int> sf::Glsl::Ivec3

3D int vector (ivec3 in GLSL)

Definition at line 88 of file Glsl.hpp.

typedef Vector2<float> sf::Glsl::Vec2

2D float vector (vec2 in GLSL)

Definition at line 64 of file Glsl.hpp.

typedef Vector3<float> sf::Glsl::Vec3

3D float vector (vec3 in GLSL)

Definition at line 82 of file Glsl.hpp.