redefined include files of Color,half float

This commit is contained in:
2023-02-07 22:42:42 +08:00
parent d07f9d0392
commit 54b6ac3b7c
17 changed files with 535 additions and 245 deletions

View File

@@ -35,5 +35,20 @@ namespace hgl
return result;
}
template<typename T,typename T2>
inline constexpr T Clamp(const T &value,const T2 &min_value,const T2 &max_value)
{
if(value<min_value)return min_value;
if(value>max_value)return max_value;
return value;
}
template<typename T>
inline constexpr T Clamp(const T &value)
{
return Clamp<T>(value,0,1);
}
}//namespace hgl
#endif//HGL_Primary_Mathematics_INCLUDE