org.gljava.opengl
Class Texture

java.lang.Object
  extended by org.gljava.opengl.Texture

public class Texture
extends java.lang.Object

An OpenGL Texture

Version:
$Id: Texture.java,v 1.3 2005/02/10 04:18:56 ivan_ganza Exp $
Author:
Ivan Z. Ganza

Field Summary
(package private)  int height
           
(package private)  float heightRatio
           
(package private)  int target
          The GL target type
(package private)  int texHeight
           
(package private)  int textureID
          The GL texture ID
(package private)  int texWidth
           
(package private)  int width
           
(package private)  float widthRatio
           
 
Constructor Summary
Texture(int target, int textureID)
          Create a new texture
 
Method Summary
 void bind(GL gl)
          Bind the specified GL context to a texture
private  void calculateHeightRatio()
          Set the height of the texture.
private  void calculateWidthRatio()
          Set the width of the texture.
 float getHeight()
          Get the height of the physical texture
 int getImageHeight()
          Get the height of the original image
 int getImageWidth()
          Get the width of the original image
 float getWidth()
          Get the width of the physical texture
 void setHeight(int height)
          Set the height of the image
 void setTextureHeight(int texHeight)
          Set the height of this texture
 void setTextureWidth(int texWidth)
          Set the width of this texture
 void setWidth(int width)
          Set the width of the image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

int target
The GL target type


textureID

int textureID
The GL texture ID


width

int width

height

int height

texWidth

int texWidth

texHeight

int texHeight

widthRatio

float widthRatio

heightRatio

float heightRatio
Constructor Detail

Texture

public Texture(int target,
               int textureID)
Create a new texture

Parameters:
target - The GL target
textureID - The GL texture ID
Method Detail

bind

public void bind(GL gl)
Bind the specified GL context to a texture

Parameters:
gl - The GL context to bind to

setHeight

public void setHeight(int height)
Set the height of the image

Parameters:
height - The height of the image

setWidth

public void setWidth(int width)
Set the width of the image

Parameters:
width - The width of the image

getImageHeight

public int getImageHeight()
Get the height of the original image

Returns:
The height of the original image

getImageWidth

public int getImageWidth()
Get the width of the original image

Returns:
The width of the original image

getHeight

public float getHeight()
Get the height of the physical texture

Returns:
The height of physical texture

getWidth

public float getWidth()
Get the width of the physical texture

Returns:
The width of physical texture

setTextureHeight

public void setTextureHeight(int texHeight)
Set the height of this texture

Parameters:
texHeight - The height of the texture

setTextureWidth

public void setTextureWidth(int texWidth)
Set the width of this texture

Parameters:
texWidth - The width of the texture

calculateHeightRatio

private void calculateHeightRatio()
Set the height of the texture. This will update the ratio also.


calculateWidthRatio

private void calculateWidthRatio()
Set the width of the texture. This will update the ratio also.