vrchess
diff src/texture.cc @ 6:3c36bc28c6c2
more stuff in the vr test
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 21 Aug 2014 01:08:03 +0300 |
parents | 879194e4b1f0 |
children | bd8202d6d28d |
line diff
1.1 --- a/src/texture.cc Wed Aug 20 16:34:43 2014 +0300 1.2 +++ b/src/texture.cc Thu Aug 21 01:08:03 2014 +0300 1.3 @@ -75,3 +75,14 @@ 1.4 set_image(image); 1.5 return true; 1.6 } 1.7 + 1.8 +unsigned int next_pow2(unsigned int x) 1.9 +{ 1.10 + x -= 1; 1.11 + x |= x >> 1; 1.12 + x |= x >> 2; 1.13 + x |= x >> 4; 1.14 + x |= x >> 8; 1.15 + x |= x >> 16; 1.16 + return x + 1; 1.17 +}