com.threerings.opengl.util
Class GlUtil

java.lang.Object
  extended by com.threerings.opengl.util.GlUtil

public class GlUtil
extends Object

Various static methods of general utility.


Constructor Summary
GlUtil()
           
 
Method Summary
static
<T> void
divide(T[] a, Comparator<? super T> comp)
          Divides the provided array into two halves, so that the first half contains all of the elements less than the median, and the second half contains all of the elements equal to or greater than the median.
static int nextPowerOfTwo(int value)
          Returns the smallest power-of-two that is greater than or equal to the supplied (positive) value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlUtil

public GlUtil()
Method Detail

nextPowerOfTwo

public static int nextPowerOfTwo(int value)
Returns the smallest power-of-two that is greater than or equal to the supplied (positive) value.


divide

public static <T> void divide(T[] a,
                              Comparator<? super T> comp)
Divides the provided array into two halves, so that the first half contains all of the elements less than the median, and the second half contains all of the elements equal to or greater than the median. This code is adapted from Wikipedia's page on Selection algorithms.



Copyright © 2011. All Rights Reserved.