com.brackeen.javagamebook.graphics3D.texture
Class PowerOf2Texture

java.lang.Object
  extended bycom.brackeen.javagamebook.graphics3D.texture.Texture
      extended bycom.brackeen.javagamebook.graphics3D.texture.PowerOf2Texture

public final class PowerOf2Texture
extends Texture

The PowerOf2Texture class is a Texture with a width and height that are a power of 2 (32, 128, etc.).


Constructor Summary
PowerOf2Texture(short[] buffer, int widthBits, int heightBits)
          Creates a new PowerOf2Texture with the specified buffer.
 
Method Summary
 short getColor(int x, int y)
          Gets the 16-bit color of the pixel at location (x,y) in the bitmap.
 
Methods inherited from class com.brackeen.javagamebook.graphics3D.texture.Texture
countbits, createTexture, createTexture, createTexture, createTexture, getHeight, getWidth, isPowerOfTwo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PowerOf2Texture

public PowerOf2Texture(short[] buffer,
                       int widthBits,
                       int heightBits)
Creates a new PowerOf2Texture with the specified buffer. The width of the bitmap is 2 to the power of widthBits, or (1 << widthBits). Likewise, the height of the bitmap is 2 to the power of heightBits, or (1 << heightBits).

Method Detail

getColor

public short getColor(int x,
                      int y)
Gets the 16-bit color of the pixel at location (x,y) in the bitmap.

Specified by:
getColor in class Texture