diff --git a/inc/hgl/TypeFunc.h b/inc/hgl/TypeFunc.h index d925004b..cf4596ad 100644 --- a/inc/hgl/TypeFunc.h +++ b/inc/hgl/TypeFunc.h @@ -398,6 +398,14 @@ namespace hgl memcpy(&x,&y,sizeof(T)); memcpy(&y,&t,sizeof(T)); } + + template T hgl_clamp(const T &cur,const T &min_value,const T &max_value) + { + if(curmax_value)return max_value; + + return cur; + } template inline T hgl_abs(const T &v){return (v>=0?v:-v);}