gtc_type_ptr Module Reference

Include < glm/gtc/type_ptr.hpp > to use the features of this extension.

Handles the interaction between pointers and vector, matrix types.

This extension defines an overloaded function, glm::value_ptr . It returns a pointer to the memory layout of the object. Matrix types store their values in column-major order.

This is useful for uploading data to matrices or copying data to buffer objects.

Example:

#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>

glm::vec3 aVector(3);
glm::mat4 someMatrix(1.0);

glUniform3fv(uniformLoc, 1, glm::value_ptr(aVector));
glUniformMatrix4fv(uniformMatrixLoc, 1, GL_FALSE, glm::value_ptr(someMatrix));

< glm/gtc/type_ptr.hpp > need to be included to use the features of this extension.


Public Member Functions

  • GLM_FUNC_QUALIFIER T const *
    value_ptr (vec< 2, T, Q > const &v)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (vec< 2, T, Q > &v)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (vec< 3, T, Q > const &v)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (vec< 3, T, Q > &v)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (vec< 4, T, Q > const &v)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (vec< 4, T, Q > &v)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (mat< 2, 2, T, Q > const &m)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (mat< 2, 2, T, Q > &m)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (mat< 3, 3, T, Q > const &m)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (mat< 3, 3, T, Q > &m)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (mat< 4, 4, T, Q > const &m)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (mat< 4, 4, T, Q > &m)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (mat< 2, 3, T, Q > const &m)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (mat< 2, 3, T, Q > &m)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (mat< 3, 2, T, Q > const &m)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (mat< 3, 2, T, Q > &m)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (mat< 2, 4, T, Q > const &m)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (mat< 2, 4, T, Q > &m)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (mat< 4, 2, T, Q > const &m)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (mat< 4, 2, T, Q > &m)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (mat< 3, 4, T, Q > const &m)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (mat< 3, 4, T, Q > &m)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (mat< 4, 3, T, Q > const &m)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (mat< 4, 3, T, Q > &m)
  • GLM_FUNC_QUALIFIER T const *
    value_ptr (qua< T, Q > const &q)
  • GLM_FUNC_QUALIFIER T *
    value_ptr (qua< T, Q > &q)