diff options
author | Kenneth Russel <[email protected]> | 2006-01-06 22:41:40 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-01-06 22:41:40 +0000 |
commit | 70c36cd428912af7cd4528e53957c45cf1886696 (patch) | |
tree | 358c1175cc6a028fe686ce03db34bade17b826b4 /src | |
parent | 3d64d2ec821ef87d049e713d09922c594d2179cb (diff) |
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
Diffstat (limited to 'src')
-rwxr-xr-x | src/demos/texture/TestTexture.java | 11 |
1 files changed, 5 insertions, 6 deletions
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(); |