summaryrefslogtreecommitdiff
path: root/utility
diff options
context:
space:
mode:
Diffstat (limited to 'utility')
-rw-r--r--utility/stream_support.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/utility/stream_support.hpp b/utility/stream_support.hpp
new file mode 100644
index 0000000..6ab1bd1
--- /dev/null
+++ b/utility/stream_support.hpp
@@ -0,0 +1,20 @@
+#ifndef STREAM_SUPPORT_H
+#define STREAM_SUPPORT_H
+
+#include <iostream>
+
+template<glm::length_t L, glm::length_t R, typename T, glm::qualifier Q>
+std::ostream &
+operator<<(std::ostream & s, glm::mat<L, R, T, Q> & m)
+{
+ for (int y = 0; y < m.length(); y++) {
+ const auto & col = m[y];
+ for (int x = 0; x < col.length(); x++) {
+ s << col[x] << ", ";
+ }
+ s << "\n";
+ }
+ return s;
+}
+
+#endif