Label rendering a bit better

This commit is contained in:
2023-12-14 23:29:54 -06:00
parent 9eee482883
commit 2074cc9211
13 changed files with 201 additions and 61 deletions

View File

@ -105,7 +105,7 @@ namespace Dawn {
* @return Rounded number.
*/
template<typename T>
static T round(float_t n) {
static T round(const float_t n) {
return (T)roundf(n);
}
@ -115,8 +115,41 @@ namespace Dawn {
* @return Rounded number.
*/
template<typename T>
static T floor(float_t n) {
static T floor(const float_t n) {
return (T)floorf(n);
}
/**
* Get the square root of a number.
*
* @param n Number to get the square root of.
* @return float_t
*/
static float_t sqrt(const float_t n) {
return sqrtf(n);
}
template<typename T>
static T ceil(const float_t n) {
return (T)ceilf(n);
}
/**
* Returns the next power of two for the given number.
*
* @param n Number to get the next power of two for.
* @return The next power of two.
*/
template<typename T>
static T nextPowerOfTwo(T n) {
n--;
n |= n >> 1;
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
n++;
return n;
}
};
}