mirror of
https://github.com/g-truc/glm.git
synced 2024-11-29 19:34:36 +00:00
added: operator<< for tvec1<>
This commit is contained in:
parent
8b09606c7b
commit
d30aba45e0
@ -188,6 +188,8 @@ namespace glm
|
||||
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&);
|
||||
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&);
|
||||
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&);
|
||||
|
@ -218,6 +218,36 @@ namespace io
|
||||
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>
|
||||
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