Functions

GLM_GTC_type_ptr: Memory layout access.

GTC Extensions (Stable)

Used to get a pointer to the memory layout of a basic type. More...

Functions

template<typename T >
T const * value_ptr (detail::tvec2< T > const &vec)
template<typename T >
T * value_ptr (detail::tmat4x3< T > &mat)
template<typename T >
T const * value_ptr (detail::tmat4x3< T > const &mat)
template<typename T >
T * value_ptr (detail::tmat3x4< T > &mat)
template<typename T >
T const * value_ptr (detail::tmat3x4< T > const &mat)
template<typename T >
T * value_ptr (detail::tmat4x2< T > &mat)
template<typename T >
T const * value_ptr (detail::tmat4x2< T > const &mat)
template<typename T >
T * value_ptr (detail::tmat2x4< T > &mat)
template<typename T >
T const * value_ptr (detail::tmat2x4< T > const &mat)
template<typename T >
T * value_ptr (detail::tmat3x2< T > &mat)
template<typename T >
T const * value_ptr (detail::tmat3x2< T > const &mat)
template<typename T >
T * value_ptr (detail::tmat2x3< T > &mat)
template<typename T >
T const * value_ptr (detail::tmat2x3< T > const &mat)
template<typename T >
T * value_ptr (detail::tmat4x4< T > &mat)
template<typename T >
T const * value_ptr (detail::tmat4x4< T > const &mat)
template<typename T >
T * value_ptr (detail::tmat3x3< T > &mat)
template<typename T >
T const * value_ptr (detail::tmat3x3< T > const &mat)
template<typename T >
T * value_ptr (detail::tmat2x2< T > &mat)
template<typename T >
T const * value_ptr (detail::tmat2x2< T > const &mat)
template<typename T >
T * value_ptr (detail::tvec4< T > &vec)
template<typename T >
T const * value_ptr (detail::tvec4< T > const &vec)
template<typename T >
T * value_ptr (detail::tvec3< T > &vec)
template<typename T >
T const * value_ptr (detail::tvec3< T > const &vec)
template<typename T >
T * value_ptr (detail::tvec2< T > &vec)

Detailed Description

Used to get a pointer to the memory layout of a basic type.

This extension defines an overloaded function, glm::value_ptr, which takes any of the core template types. 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 these functionalities.


Function Documentation

T const* glm::gtc::type_ptr::value_ptr ( detail::tvec2< T > const &  vec)

Get the const address of the vector content.

From GLM_GTC_type_ptr extension.

Definition at line 40 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tmat4x3< T > &  mat)

Get the address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 292 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tmat4x3< T > const &  mat)

Get the const address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 282 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tmat3x4< T > &  mat)

Get the address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 271 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tmat3x4< T > const &  mat)

Get the const address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 260 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tmat4x2< T > &  mat)

Get the address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 249 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tmat4x2< T > const &  mat)

Get the const address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 238 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tmat2x4< T > &  mat)

Get the address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 227 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tmat2x4< T > const &  mat)

Get the const address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 216 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tmat3x2< T > &  mat)

Get the address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 205 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tmat3x2< T > const &  mat)

Get the const address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 194 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tmat2x3< T > &  mat)

Get the address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 183 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tmat2x3< T > const &  mat)

Get the const address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 172 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tmat4x4< T > &  mat)

Get the address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 161 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tmat4x4< T > const &  mat)

Get the const address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 150 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tmat3x3< T > &  mat)

Get the address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 139 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tmat3x3< T > const &  mat)

Get the const address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 128 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tmat2x2< T > &  mat)

Get the address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 117 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tmat2x2< T > const &  mat)

Get the const address of the matrix content.

From GLM_GTC_type_ptr extension.

Definition at line 106 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tvec4< T > &  vec)

Get the address of the vector content.

From GLM_GTC_type_ptr extension.

Definition at line 95 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tvec4< T > const &  vec)

Get the const address of the vector content.

From GLM_GTC_type_ptr extension.

Definition at line 84 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tvec3< T > &  vec)

Get the address of the vector content.

From GLM_GTC_type_ptr extension.

Definition at line 73 of file type_ptr.hpp.

T const* glm::gtc::type_ptr::value_ptr ( detail::tvec3< T > const &  vec)

Get the const address of the vector content.

From GLM_GTC_type_ptr extension.

Definition at line 62 of file type_ptr.hpp.

T* glm::gtc::type_ptr::value_ptr ( detail::tvec2< T > &  vec)

Get the address of the vector content.

From GLM_GTC_type_ptr extension.

Definition at line 51 of file type_ptr.hpp.