0.9.9 API documenation

- Main Page
- Modules
- Files

Functions
GLM_GTC_integer
GTC Extensions (Stable)

Allow to perform bit operations on integer values. More...

## Functions
template<length_t L, typename T , qualifier P>
GLM_FUNC_DECL vec< L, int, P > | iround (vec< L, T, P > const &x)
| Returns a value equal to the nearest integer to x. More...
template<typename genIUType >
GLM_FUNC_DECL genIUType | log2 (genIUType x)
| Returns the log2 of x for integer values. More...
template<typename genIUType >
GLM_FUNC_DECL genIUType | mod (genIUType x, genIUType y)
| Modulus. More...
template<length_t L, typename T , qualifier P>
GLM_FUNC_DECL vec< L, uint, P > | uround (vec< L, T, P > const &x)
| Returns a value equal to the nearest integer to x. More...

## Detailed Description

Allow to perform bit operations on integer values.

<glm/gtc/integer.hpp> need to be included to use these functionalities.

## Function Documentation

GLM_FUNC_DECL vec<L, int, P> glm::iround | ( | vec< L, T, P > const & | x | ) |

Returns a value equal to the nearest integer to x.

The fraction 0.5 will round in a direction chosen by the implementation, presumably the direction that is fastest.

Parameters

  x | The values of the argument must be greater or equal to zero.

Template Parameters

  T | floating point scalar types.

See also
  GLSL round man page
  GLM_GTC_integer

GLM_FUNC_DECL genIUType glm::log2 | ( | genIUType | x | ) |

Returns the log2 of x for integer values.

Can be reliably using to compute mipmap count from the texture size.

See also
  GLM_GTC_integer

GLM_FUNC_DECL genIUType glm::mod | ( | genIUType | x,
|  | genIUType | y
| ) |  |

Modulus.

Returns x % y for each component in x using the floating point value y.

Template Parameters

  genIUType | Integer-point scalar or vector types.

See also
  GLM_GTC_integer
  GLSL mod man page
  GLSL 4.20.8 specification, section 8.3 Common Functions

GLM_FUNC_DECL vec<L, uint, P> glm::uround | ( | vec< L, T, P > const & | x | ) |

Returns a value equal to the nearest integer to x.

The fraction 0.5 will round in a direction chosen by the implementation, presumably the direction that is fastest.

Parameters

  x | The values of the argument must be greater or equal to zero.

Template Parameters

  T | floating point scalar types.

See also
  GLSL round man page
  GLM_GTC_integer