Top Description Fields Constructors Methods
org.lwjgl.util.glu

public Class Util

extends Object
Class Inheritance
Known Direct Subclasses
org.lwjgl.util.glu.MipMap, org.lwjgl.util.glu.PixelStoreState, org.lwjgl.util.glu.Project, org.lwjgl.util.glu.Registry
Imports
java.nio.IntBuffer, org.lwjgl.BufferUtils

Util.java

Created 7-jan-2004

Author
Erik Duijs

Field Summary

Modifier and TypeField and Description
private static IntBuffer
scratch

temp IntBuffer of one for getting an int from some GL functions

Constructor Summary

AccessConstructor and Description
public
Util()

Method Summary

Modifier and TypeMethod and Description
protected static int

Returns:

int
bytesPerPixel
(int format, int type)

Method bytesPerPixel.

protected static int

Returns:

int
ceil
(int a, int b)

Return ceiling of integer division

protected static int

Returns:

int
compPerPix
(int format)

Method compPerPix.

protected static void
cross(float[] v1, float[] v2, float[] result)

Calculate cross-product

protected static int

Returns:

int
glGetIntegerv
(int what)

Convenience method for returning an int, rather than getting it out of a buffer yourself.

protected static int

Returns:

int
nearestPower
(int value)

Method nearestPower.

protected static float[]

Returns:

float[]
normalize
(float[] v)

Normalize vector

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

scratchback to summary
private static IntBuffer scratch

temp IntBuffer of one for getting an int from some GL functions

Constructor Detail

Utilback to summary
public Util()

Method Detail

bytesPerPixelback to summary
protected static int bytesPerPixel(int format, int type)

Method bytesPerPixel.

Returns:int

int

ceilback to summary
protected static int ceil(int a, int b)

Return ceiling of integer division

Returns:int

int

compPerPixback to summary
protected static int compPerPix(int format)

Method compPerPix.

Returns:int

int

crossback to summary
protected static void cross(float[] v1, float[] v2, float[] result)

Calculate cross-product

glGetIntegervback to summary
protected static int glGetIntegerv(int what)

Convenience method for returning an int, rather than getting it out of a buffer yourself.

Returns:int

int

nearestPowerback to summary
protected static int nearestPower(int value)

Method nearestPower.

Compute the nearest power of 2 number. This algorithm is a little strange, but it works quite well.

Returns:int

int

normalizeback to summary
protected static float[] normalize(float[] v)

Normalize vector

Returns:float[]

float[]