org.gljava.opengl

Class Texture

public class Texture extends 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
intheight
floatheightRatio
inttarget
The GL target type
inttexHeight
inttextureID
The GL texture ID
inttexWidth
intwidth
floatwidthRatio
Constructor Summary
Texture(int target, int textureID)
Create a new texture
Method Summary
voidbind(GL gl)
Bind the specified GL context to a texture
voidcalculateHeightRatio()
Set the height of the texture.
voidcalculateWidthRatio()
Set the width of the texture.
floatgetHeight()
Get the height of the physical texture
intgetImageHeight()
Get the height of the original image
intgetImageWidth()
Get the width of the original image
floatgetWidth()
Get the width of the physical texture
voidsetHeight(int height)
Set the height of the image
voidsetTextureHeight(int texHeight)
Set the height of this texture
voidsetTextureWidth(int texWidth)
Set the width of this texture
voidsetWidth(int width)
Set the width of the image

Field Detail

height

int height

heightRatio

float heightRatio

target

int target
The GL target type

texHeight

int texHeight

textureID

int textureID
The GL texture ID

texWidth

int texWidth

width

int width

widthRatio

float widthRatio

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

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.

getHeight

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

Returns: The height of physical texture

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

getWidth

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

Returns: The width of physical texture

setHeight

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

Parameters: height The height of the image

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

setWidth

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

Parameters: width The width of the image