Improve mask implementation to support any integer and vector types

This commit is contained in:
Christophe Riccio
2014-10-28 20:28:26 +01:00
parent a88d8935be
commit 44382faf59
4 changed files with 133 additions and 31 deletions

View File

@@ -44,7 +44,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER int mask(int Bits)
{
return Bits >= 32 ? 0xffffffff : (static_cast<int>(1) << Bits) - static_cast<int>(1);
return ~((~0) << Bits);
}
}//namespace detail