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

« back to all changes in this revision

Viewing changes to 3rd_party/glm/glm/core/type_gentype.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 core
24
 
/// @file glm/core/type_gentype.hpp
25
 
/// @date 2008-10-05 / 2011-06-15
26
 
/// @author Christophe Riccio
27
 
///////////////////////////////////////////////////////////////////////////////////
28
 
 
29
 
#ifndef glm_core_type_gentype
30
 
#define glm_core_type_gentype
31
 
 
32
 
#include "type_size.hpp"
33
 
 
34
 
namespace glm
35
 
{
36
 
        enum profile
37
 
        {
38
 
                nice,
39
 
                fast,
40
 
                simd
41
 
        };
42
 
 
43
 
namespace detail
44
 
{
45
 
        template
46
 
        <
47
 
                typename VALTYPE, 
48
 
                template <typename> class TYPE
49
 
        >
50
 
        struct genType
51
 
        {
52
 
        public:
53
 
                enum ctor{null};
54
 
 
55
 
                typedef VALTYPE value_type;
56
 
                typedef VALTYPE & value_reference;
57
 
                typedef VALTYPE * value_pointer;
58
 
                typedef VALTYPE const * value_const_pointer;
59
 
                typedef TYPE<bool> bool_type;
60
 
 
61
 
                typedef sizeType size_type;
62
 
                static bool is_vector();
63
 
                static bool is_matrix();
64
 
                
65
 
                typedef TYPE<VALTYPE> type;
66
 
                typedef TYPE<VALTYPE> * pointer;
67
 
                typedef TYPE<VALTYPE> const * const_pointer;
68
 
                typedef TYPE<VALTYPE> const * const const_pointer_const;
69
 
                typedef TYPE<VALTYPE> * const pointer_const;
70
 
                typedef TYPE<VALTYPE> & reference;
71
 
                typedef TYPE<VALTYPE> const & const_reference;
72
 
                typedef TYPE<VALTYPE> const & param_type;
73
 
 
74
 
                //////////////////////////////////////
75
 
                // Address (Implementation details)
76
 
 
77
 
                value_const_pointer value_address() const{return value_pointer(this);}
78
 
                value_pointer value_address(){return value_pointer(this);}
79
 
 
80
 
        //protected:
81
 
        //      enum kind
82
 
        //      {
83
 
        //              GEN_TYPE,
84
 
        //              VEC_TYPE,
85
 
        //              MAT_TYPE
86
 
        //      };
87
 
 
88
 
        //      typedef typename TYPE::kind kind;
89
 
        };
90
 
 
91
 
        template
92
 
        <
93
 
                typename VALTYPE, 
94
 
                template <typename> class TYPE
95
 
        >
96
 
        bool genType<VALTYPE, TYPE>::is_vector()
97
 
        {
98
 
                return true;
99
 
        }
100
 
/*
101
 
        template <typename valTypeT, unsigned int colT, unsigned int rowT, profile proT = nice>
102
 
        class base
103
 
        {
104
 
        public:
105
 
                //////////////////////////////////////
106
 
                // Traits
107
 
 
108
 
                typedef sizeType                                                        size_type;
109
 
                typedef valTypeT                                                        value_type;
110
 
 
111
 
                typedef base<value_type, colT, rowT>            class_type;
112
 
 
113
 
                typedef base<bool, colT, rowT>                          bool_type;
114
 
                typedef base<value_type, rowT, 1>                       col_type;
115
 
                typedef base<value_type, colT, 1>                       row_type;
116
 
                typedef base<value_type, rowT, colT>            transpose_type;
117
 
 
118
 
                static size_type                                                        col_size();
119
 
                static size_type                                                        row_size();
120
 
                static size_type                                                        value_size();
121
 
                static bool                                                                     is_scalar();
122
 
                static bool                                                                     is_vector();
123
 
                static bool                                                                     is_matrix();
124
 
 
125
 
        private:
126
 
                // Data 
127
 
                col_type value[colT];           
128
 
 
129
 
        public:
130
 
                //////////////////////////////////////
131
 
                // Constructors
132
 
                base();
133
 
                base(class_type const & m);
134
 
 
135
 
                explicit base(value_type const & x);
136
 
                explicit base(value_type const * const x);
137
 
                explicit base(col_type const * const x);
138
 
 
139
 
                //////////////////////////////////////
140
 
                // Conversions
141
 
                template <typename vU, uint cU, uint rU, profile pU>
142
 
                explicit base(base<vU, cU, rU, pU> const & m);
143
 
 
144
 
                //////////////////////////////////////
145
 
                // Accesses
146
 
                col_type& operator[](size_type i);
147
 
                col_type const & operator[](size_type i) const;
148
 
 
149
 
                //////////////////////////////////////
150
 
                // Unary updatable operators
151
 
                class_type& operator=  (class_type const & x);
152
 
                class_type& operator+= (value_type const & x);
153
 
                class_type& operator+= (class_type const & x);
154
 
                class_type& operator-= (value_type const & x);
155
 
                class_type& operator-= (class_type const & x);
156
 
                class_type& operator*= (value_type const & x);
157
 
                class_type& operator*= (class_type const & x);
158
 
                class_type& operator/= (value_type const & x);
159
 
                class_type& operator/= (class_type const & x);
160
 
                class_type& operator++ ();
161
 
                class_type& operator-- ();
162
 
        };
163
 
*/
164
 
        }//namespace detail
165
 
}//namespace glm
166
 
 
167
 
//#include "type_gentype.inl"
168
 
 
169
 
#endif//glm_core_type_gentype