Returns the nearest power of 2 to the given value
.
name | type | description |
---|---|---|
value | number |
The value. |
The nearest power of 2 to value
.
Checks if the given width
and height
are a power of two.
Useful for checking texture dimensions.
name | type | description |
---|---|---|
width | number |
The width. |
height | number |
The height. |
true
if width
and height
are a power of two, otherwise false
.
Tests the value and returns true
if it is a power of two.
name | type | description |
---|---|---|
value | number |
The value to check if it's a power of two. |
Returns true
if value
is a power of two, otherwise false
.