~mir-team/mir/in-process-egl+input-conglomeration

« back to all changes in this revision

Viewing changes to 3rd_party/glm/glm/gtc/type_ptr.hpp

Merged trunk and fixed issues

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
///////////////////////////////////////////////////////////////////////////////////
2
 
/// OpenGL Mathematics (glm.g-truc.net)
3
 
///
4
 
/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
5
 
/// Permission is hereby granted, free of charge, to any person obtaining a copy
6
 
/// of this software and associated documentation files (the "Software"), to deal
7
 
/// in the Software without restriction, including without limitation the rights
8
 
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
 
/// copies of the Software, and to permit persons to whom the Software is
10
 
/// furnished to do so, subject to the following conditions:
11
 
/// 
12
 
/// The above copyright notice and this permission notice shall be included in
13
 
/// all copies or substantial portions of the Software.
14
 
/// 
15
 
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
 
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
 
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
 
/// THE SOFTWARE.
22
 
///
23
 
/// @ref gtc_type_ptr
24
 
/// @file glm/gtc/type_ptr.hpp
25
 
/// @date 2009-05-06 / 2011-06-05
26
 
/// @author Christophe Riccio
27
 
///
28
 
/// @see core (dependence)
29
 
/// @see gtc_half_float (dependence)
30
 
/// @see gtc_quaternion (dependence)
31
 
///
32
 
/// @defgroup gtc_type_ptr GLM_GTC_type_ptr: Memory layout access
33
 
/// @ingroup gtc
34
 
///
35
 
/// @brief Handles the interaction between pointers and vector, matrix types.
36
 
/// 
37
 
/// This extension defines an overloaded function, glm::value_ptr, which
38
 
/// takes any of the \ref core_template "core template types". It returns
39
 
/// a pointer to the memory layout of the object. Matrix types store their values
40
 
/// in column-major order.
41
 
/// 
42
 
/// This is useful for uploading data to matrices or copying data to buffer objects.
43
 
///
44
 
/// Example:
45
 
/// @code
46
 
/// #include <glm/glm.hpp>
47
 
/// #include <glm/gtc/type_ptr.hpp>
48
 
/// 
49
 
/// glm::vec3 aVector(3);
50
 
/// glm::mat4 someMatrix(1.0);
51
 
/// 
52
 
/// glUniform3fv(uniformLoc, 1, glm::value_ptr(aVector));
53
 
/// glUniformMatrix4fv(uniformMatrixLoc, 1, GL_FALSE, glm::value_ptr(someMatrix));
54
 
/// @endcode
55
 
/// 
56
 
/// <glm/gtc/type_ptr.hpp> need to be included to use these functionalities.
57
 
///////////////////////////////////////////////////////////////////////////////////
58
 
 
59
 
#ifndef GLM_GTC_type_ptr
60
 
#define GLM_GTC_type_ptr GLM_VERSION
61
 
 
62
 
// Dependency:
63
 
#include "../glm.hpp"
64
 
#include "../gtc/half_float.hpp"
65
 
#include "../gtc/quaternion.hpp"
66
 
#include <cstring>
67
 
 
68
 
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
69
 
#       pragma message("GLM: GLM_GTC_type_ptr extension included")
70
 
#endif
71
 
 
72
 
namespace glm
73
 
74
 
        /// @addtogroup gtc_type_ptr
75
 
        /// @{
76
 
    
77
 
        /// Return the constant address to the data of the input parameter.
78
 
    /// @see gtc_type_ptr
79
 
        template<typename genType>
80
 
    typename genType::value_type const * value_ptr(genType const & vec);
81
 
 
82
 
        /// Build a vector from a pointer.
83
 
        /// @see gtc_type_ptr
84
 
        template<typename T>
85
 
    detail::tvec2<T> make_vec2(T const * const ptr);
86
 
 
87
 
        /// Build a vector from a pointer.
88
 
        /// @see gtc_type_ptr
89
 
        template<typename T>
90
 
    detail::tvec3<T> make_vec3(T const * const ptr);
91
 
 
92
 
        /// Build a vector from a pointer.
93
 
        /// @see gtc_type_ptr
94
 
        template<typename T>
95
 
    detail::tvec4<T> make_vec4(T const * const ptr);
96
 
 
97
 
        /// Build a matrix from a pointer.
98
 
        /// @see gtc_type_ptr
99
 
        template<typename T>
100
 
    detail::tmat2x2<T> make_mat2x2(T const * const ptr);
101
 
        
102
 
        /// Build a matrix from a pointer.
103
 
        /// @see gtc_type_ptr
104
 
        template<typename T>
105
 
    detail::tmat2x3<T> make_mat2x3(T const * const ptr);
106
 
        
107
 
        /// Build a matrix from a pointer.
108
 
        /// @see gtc_type_ptr
109
 
        template<typename T>
110
 
    detail::tmat2x4<T> make_mat2x4(T const * const ptr);
111
 
        
112
 
        /// Build a matrix from a pointer.
113
 
        /// @see gtc_type_ptr
114
 
        template<typename T>
115
 
    detail::tmat3x2<T> make_mat3x2(T const * const ptr);
116
 
        
117
 
        /// Build a matrix from a pointer.
118
 
        /// @see gtc_type_ptr
119
 
        template<typename T>
120
 
    detail::tmat3x3<T> make_mat3x3(T const * const ptr);
121
 
 
122
 
        /// Build a matrix from a pointer.
123
 
        /// @see gtc_type_ptr
124
 
        template<typename T>
125
 
    detail::tmat3x4<T> make_mat3x4(T const * const ptr);
126
 
        
127
 
        /// Build a matrix from a pointer.
128
 
        /// @see gtc_type_ptr
129
 
        template<typename T>
130
 
    detail::tmat4x2<T> make_mat4x2(
131
 
        T const * const ptr);
132
 
        
133
 
        /// Build a matrix from a pointer.
134
 
        /// @see gtc_type_ptr
135
 
        template<typename T>
136
 
    detail::tmat4x3<T> make_mat4x3(T const * const ptr);
137
 
        
138
 
        /// Build a matrix from a pointer.
139
 
        /// @see gtc_type_ptr
140
 
        template<typename T>
141
 
    detail::tmat4x4<T> make_mat4x4(T const * const ptr);
142
 
        
143
 
        /// Build a matrix from a pointer.
144
 
        /// @see gtc_type_ptr
145
 
        template<typename T>
146
 
    detail::tmat2x2<T> make_mat2(T const * const ptr);
147
 
        
148
 
        /// Build a matrix from a pointer.
149
 
        /// @see gtc_type_ptr
150
 
        template<typename T>
151
 
    detail::tmat3x3<T> make_mat3(T const * const ptr);
152
 
                
153
 
        /// Build a matrix from a pointer.
154
 
        /// @see gtc_type_ptr
155
 
        template<typename T>
156
 
    detail::tmat4x4<T> make_mat4(T const * const ptr);
157
 
 
158
 
        /// Build a quaternion from a pointer.
159
 
        /// @see gtc_type_ptr
160
 
        template<typename T>
161
 
    detail::tquat<T> make_quat(T const * const ptr);
162
 
    
163
 
        /// @}
164
 
}//namespace glm
165
 
 
166
 
#include "type_ptr.inl"
167
 
 
168
 
#endif//GLM_GTC_type_ptr
169