public class

Texture

extends Object
java.lang.Object
   ↳ casmi.image.Texture

Class Overview

Texture class. Wrap JOGL and make it easy to use.

Summary

Constants
int LINES
int LINES_3D
int LINE_LOOP
Fields
protected double height
protected Image image
protected boolean requireToLoad
protected boolean requireToReload
protected double width
Public Constructors
Texture(String path)
Creates a new Texture using the Image's path.
Texture(URL url)
Creates a new Texture using the Image's url.
Texture(Image image)
Creates a new Texture using the Image.
Public Methods
final void disableTexture(GL2 gl)
final void enableTexture(GL2 gl)
void flip(TextureFlipMode mode)
Flips the way of mapping the texture.
BufferedImage getBufferedImage()
final double getHeight()
Gets the height of this Texture.
final Image getImage()
float getTextureCorner(int index1, int index2)
final double getWidth()
Gets the width of this Texture.
void load()
void reload()
void render(GL2 gl)
void rotation(TextureRotationMode mode)
Rotates the way of mapping the texture.
void setTextureCorner(int index, double x, double y)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int LINES

Constant Value: 1 (0x00000001)

public static final int LINES_3D

Constant Value: 3 (0x00000003)

public static final int LINE_LOOP

Constant Value: 51 (0x00000033)

Fields

protected double height

protected Image image

protected boolean requireToLoad

protected boolean requireToReload

protected double width

Public Constructors

public Texture (String path)

Creates a new Texture using the Image's path.

Parameters
path The path of Image.

public Texture (URL url)

Creates a new Texture using the Image's url.

Parameters
url The url of Image.

public Texture (Image image)

Creates a new Texture using the Image.

Parameters
image The Image of this Texture.

Public Methods

public final void disableTexture (GL2 gl)

public final void enableTexture (GL2 gl)

public void flip (TextureFlipMode mode)

Flips the way of mapping the texture.

Parameters
mode The alignment of the position of the Texture.
See Also

public BufferedImage getBufferedImage ()

public final double getHeight ()

Gets the height of this Texture.

Returns
  • The height of the Texture.

public final Image getImage ()

public float getTextureCorner (int index1, int index2)

public final double getWidth ()

Gets the width of this Texture.

Returns
  • The width of the Texture.

public void load ()

public void reload ()

public void render (GL2 gl)

public void rotation (TextureRotationMode mode)

Rotates the way of mapping the texture.

Parameters
mode The alignment of the position of the Texture.
See Also

public void setTextureCorner (int index, double x, double y)