From 70c36cd428912af7cd4528e53957c45cf1886696 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 6 Jan 2006 22:41:40 +0000 Subject: Changed how Texture returns texture coordinates for both the entire image as well as a sub-image. Added TextureCoords class. Updated TestTexture demo. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@161 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4 --- src/demos/texture/TestTexture.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/demos/texture/TestTexture.java') diff --git a/src/demos/texture/TestTexture.java b/src/demos/texture/TestTexture.java index 0c4492c..8ca89e2 100755 --- a/src/demos/texture/TestTexture.java +++ b/src/demos/texture/TestTexture.java @@ -182,17 +182,16 @@ public class TestTexture implements GLEventListener { texture.enable(); gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE); texture.bind(); - Point2D lowerLeft = texture.getImageLowerLeftTexCoord(); - Point2D upperRight = texture.getImageUpperRightTexCoord(); + TextureCoords coords = texture.getImageTexCoords(); gl.glBegin(GL.GL_QUADS); - gl.glTexCoord2d(lowerLeft.getX(), lowerLeft.getY()); + gl.glTexCoord2f(coords.left(), coords.bottom()); gl.glVertex3f(0, 0, 0); - gl.glTexCoord2d(upperRight.getX(), lowerLeft.getY()); + gl.glTexCoord2f(coords.right(), coords.bottom()); gl.glVertex3f(1, 0, 0); - gl.glTexCoord2d(upperRight.getX(), upperRight.getY()); + gl.glTexCoord2f(coords.right(), coords.top()); gl.glVertex3f(1, 1, 0); - gl.glTexCoord2d(lowerLeft.getX(), upperRight.getY()); + gl.glTexCoord2f(coords.left(), coords.top()); gl.glVertex3f(0, 1, 0); gl.glEnd(); texture.disable(); -- cgit v1.2.3