SFML
Simple and Fast Multimedia Library
Loading...
Searching...
No Matches
sf::Glsl Namespace Reference

Namespace with GLSL types. More...

Typedefs

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

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 type aliases, 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

◆ Bvec2

using sf::Glsl::Bvec2 = Vector2<bool>

2D bool vector (bvec2 in GLSL)

◆ Bvec3

using sf::Glsl::Bvec3 = Vector3<bool>

3D bool vector (bvec3 in GLSL)

◆ Bvec4

◆ Ivec2

using sf::Glsl::Ivec2 = Vector2<int>

2D int vector (ivec2 in GLSL)

◆ Ivec3

using sf::Glsl::Ivec3 = Vector3<int>

3D int vector (ivec3 in GLSL)

◆ Ivec4

◆ Mat3

◆ Mat4

◆ Vec2

using sf::Glsl::Vec2 = Vector2<float>

2D float vector (vec2 in GLSL)

◆ Vec3

using sf::Glsl::Vec3 = Vector3<float>

3D float vector (vec3 in GLSL)

◆ Vec4

using sf::Glsl::Vec4 = priv::Vector4<float>