GLM 0.9.5

- Main Page
- Related Pages
- Modules
- Namespaces
- Files

- File List

xstream.hpp
Go to the documentation of this file.
1
39 #ifndef GLM_VIRTREV_xstream
40 #define GLM_VIRTREV_xstream GLM_VERSION
41
42 #include "../glm.hpp"
43 #include "../gtc/matrix_access.hpp"
44 #include <iostream>
45
46 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
47 # pragma message("GLM: GLM_VIRTREV_xstream extension included")
48 #endif
49 /*
50 namespace glm{
51 namespace detail
52 {
53 template<typename T>
54 std::ostream & operator << (std::ostream & stream, glm::detail::tvec2<T, P> const & vec)
55 {
56 stream << "<glm_vec2 ";
57 stream << "x=\"" << vec.x << "\" ";
58 stream << "y=\"" << vec.y << "\" ";
59 stream << "/>";
60
61 return stream;
62 }
63
64 template<typename T>
65 std::ostream & operator << (std::ostream & stream, glm::detail::tvec3<T, P> const & vec)
66 {
67 stream << "<glm_vec3 ";
68 stream << "x=\"" << vec.x << "\" ";
69 stream << "y=\"" << vec.y << "\" ";
70 stream << "z=\"" << vec.z << "\" ";
71 stream << "/>";
72
73 return stream;
74 }
75
76 template<typename T>
77 std::ostream & operator << (std::ostream & stream, glm::detail::tvec4<T, P> const & vec)
78 {
79 stream << "<glm_vec4 ";
80 stream << "x=\"" << vec.x << "\" ";
81 stream << "y=\"" << vec.y << "\" ";
82 stream << "z=\"" << vec.z << "\" ";
83 stream << "w=\"" << vec.w << "\" ";
84 stream << "/>";
85
86 return stream;
87 }
88
89 template<typename T>
90 std::ostream & operator << (std::ostream & stream, glm::detail::tmat2x2<T, P> const & mat)
91 {
92 stream << "<glm_mat2>" << std::endl;
93 stream << "<row ";
94 stream << "x=\"" << glm::row(mat, 0)[0] << "\" ";
95 stream << "y=\"" << glm::row(mat, 0)[1] << "\" ";
96 stream << "/>" << std::endl;
97 stream << "<row ";
98 stream << "x=\"" << glm::row(mat, 1)[0] << "\" ";
99 stream << "y=\"" << glm::row(mat, 1)[1] << "\" ";
100 stream << "/>" << std::endl;
101 stream << "</glm_mat2>";
102
103 return stream;
104 }
105
106 template<typename T>
107 std::ostream & operator << (std::ostream & stream, glm::detail::tmat3x3<T, P> const & mat)
108 {
109 stream << "<glm_mat3>" << std::endl;
110 stream << "<row ";
111 stream << "x=\"" << glm::row(mat, 0)[0] << "\" ";
112 stream << "y=\"" << glm::row(mat, 0)[1] << "\" ";
113 stream << "z=\"" << glm::row(mat, 0)[2] << "\" ";
114 stream << "/>" << std::endl;
115 stream << "<row ";
116 stream << "x=\"" << glm::row(mat, 1)[0] << "\" ";
117 stream << "y=\"" << glm::row(mat, 1)[1] << "\" ";
118 stream << "z=\"" << glm::row(mat, 1)[2] << "\" ";
119 stream << "/>" << std::endl;
120 stream << "<row ";
121 stream << "x=\"" << glm::row(mat, 2)[0] << "\" ";
122 stream << "y=\"" << glm::row(mat, 2)[1] << "\" ";
123 stream << "z=\"" << glm::row(mat, 2)[2] << "\" ";
124 stream << "/>" << std::endl;
125 stream << "</glm_mat3>";
126
127 return stream;
128 }
129
130 template<typename T>
131 std::ostream & operator << (std::ostream & stream, glm::detail::tmat4x4<T, P> const & mat)
132 {
133 stream << "<glm_mat4>" << std::endl;
134 stream << "<row ";
135 stream << "x=\"" << glm::row(mat, 0)[0] << "\" ";
136 stream << "y=\"" << glm::row(mat, 0)[1] << "\" ";
137 stream << "z=\"" << glm::row(mat, 0)[2] << "\" ";
138 stream << "w=\"" << glm::row(mat, 0)[3] << "\" ";
139 stream << "/>" << std::endl;
140 stream << "<row ";
141 stream << "x=\"" << glm::row(mat, 1)[0] << "\" ";
142 stream << "y=\"" << glm::row(mat, 1)[1] << "\" ";
143 stream << "z=\"" << glm::row(mat, 1)[2] << "\" ";
144 stream << "w=\"" << glm::row(mat, 1)[3] << "\" ";
145 stream << "/>" << std::endl;
146 stream << "<row ";
147 stream << "x=\"" << glm::row(mat, 2)[0] << "\" ";
148 stream << "y=\"" << glm::row(mat, 2)[1] << "\" ";
149 stream << "z=\"" << glm::row(mat, 2)[2] << "\" ";
150 stream << "w=\"" << glm::row(mat, 2)[3] << "\" ";
151 stream << "/>" << std::endl;
152 stream << "<row ";
153 stream << "x=\"" << glm::row(mat, 3)[0] << "\" ";
154 stream << "y=\"" << glm::row(mat, 3)[1] << "\" ";
155 stream << "z=\"" << glm::row(mat, 3)[2] << "\" ";
156 stream << "w=\"" << glm::row(mat, 3)[3] << "\" ";
157 stream << "/>" << std::endl;
158 stream << "</glm_mat4>";
159
160 return stream;
161 }
162
163 }//namespace detail
164 }//namespace glm
165 */
166 #endif//GLM_VIRTREV_xstream