From f918cd7c0ebc50b8521a79303e13cb775a7440d7 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Wed, 15 Nov 2006 07:30:17 +0000 Subject: Fixed Issue 247: Texture class should use GL_CLAMP if OpenGL version is 1.1 Changed code to check for presence of OpenGL 1.2 and use GL_CLAMP instead of GL_CLAMP_TO_EDGE if not available. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@984 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/util/texture/Texture.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/classes/com/sun/opengl') diff --git a/src/classes/com/sun/opengl/util/texture/Texture.java b/src/classes/com/sun/opengl/util/texture/Texture.java index 454d73c61..157ae836a 100755 --- a/src/classes/com/sun/opengl/util/texture/Texture.java +++ b/src/classes/com/sun/opengl/util/texture/Texture.java @@ -330,10 +330,9 @@ public class Texture { gl.glBindTexture(newTarget, texID); } - // REMIND: let the user specify these, optionally int minFilter = (data.getMipmap() ? GL.GL_LINEAR_MIPMAP_LINEAR : GL.GL_LINEAR); int magFilter = GL.GL_LINEAR; - int wrapMode = GL.GL_CLAMP_TO_EDGE; + int wrapMode = (gl.isExtensionAvailable("GL_VERSION_1_2") ? GL.GL_CLAMP_TO_EDGE : GL.GL_CLAMP); // REMIND: figure out what to do for GL_TEXTURE_RECTANGLE_ARB if (newTarget != GL.GL_TEXTURE_RECTANGLE_ARB) { @@ -485,8 +484,9 @@ public class Texture { * Sets the OpenGL integer texture parameter for the texture's * target. This gives control over parameters such as * GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T, which by default are set - * to GL_CLAMP_TO_EDGE. Causes this texture to be bound to the - * current texture state. + * to GL_CLAMP_TO_EDGE if OpenGL 1.2 is supported on the current + * platform and GL_CLAMP if not. Causes this texture to be bound to + * the current texture state. * * @throws GLException if no OpenGL context was current or if any * OpenGL-related errors occurred -- cgit v1.2.3