mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
Merge pull request #301 from regnirpsj/master
added: operator<< for tvec1<> #301
This commit is contained in:
commit
4ad2ad84a8
@ -188,6 +188,8 @@ namespace glm
|
|||||||
template <typename CTy, typename CTr, typename T, precision P>
|
template <typename CTy, typename CTr, typename T, precision P>
|
||||||
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tquat<T,P> const&);
|
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tquat<T,P> const&);
|
||||||
template <typename CTy, typename CTr, typename T, precision P>
|
template <typename CTy, typename CTr, typename T, precision P>
|
||||||
|
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec1<T,P> const&);
|
||||||
|
template <typename CTy, typename CTr, typename T, precision P>
|
||||||
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec2<T,P> const&);
|
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec2<T,P> const&);
|
||||||
template <typename CTy, typename CTr, typename T, precision P>
|
template <typename CTy, typename CTr, typename T, precision P>
|
||||||
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec3<T,P> const&);
|
GLM_FUNC_DECL std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>&, tvec3<T,P> const&);
|
||||||
|
@ -218,6 +218,36 @@ namespace io
|
|||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename CTy, typename CTr, typename T, precision P>
|
||||||
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec1<T,P> const& a)
|
||||||
|
{
|
||||||
|
typename std::basic_ostream<CTy,CTr>::sentry const cerberus(os);
|
||||||
|
|
||||||
|
if(cerberus)
|
||||||
|
{
|
||||||
|
io::format_punct<CTy> const & fmt(io::get_facet<io::format_punct<CTy> >(os));
|
||||||
|
|
||||||
|
if(fmt.formatted)
|
||||||
|
{
|
||||||
|
io::basic_state_saver<CTy> const bss(os);
|
||||||
|
|
||||||
|
os << std::fixed
|
||||||
|
<< std::right
|
||||||
|
<< std::setprecision(fmt.precision)
|
||||||
|
<< std::setfill(fmt.space)
|
||||||
|
<< fmt.delim_left
|
||||||
|
<< std::setw(fmt.width) << a.x
|
||||||
|
<< fmt.delim_right;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
os << a.x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename CTy, typename CTr, typename T, precision P>
|
template <typename CTy, typename CTr, typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec2<T,P> const& a)
|
GLM_FUNC_QUALIFIER std::basic_ostream<CTy,CTr>& operator<<(std::basic_ostream<CTy,CTr>& os, tvec2<T,P> const& a)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user