diff options
author | Sven Gothel <[email protected]> | 2010-03-26 15:12:51 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-03-26 15:12:51 +0100 |
commit | 138a5b057e39a4738a2e82f370424a9a21aceea9 (patch) | |
tree | e928b54a74810d968f4ca70f724ede32759f73b9 /src/jogl/classes/com/sun/opengl/util/texture/spi | |
parent | ffd4f4b39f0600a0432728ab00d20c9127200196 (diff) |
http://www.jogamp.org/bugzilla/show_bug.cgi?id=378
Changed solution with a necessary API change of TextureData etc.
Adding required GLProfile element to the factories etc,
so it is clear for which GLProfile data is being created
without the need of a current GLContext.
TextureData/AWTTextureData: Removed the glPostInit* effort ..
IMPACT: Texture util's API change - minor user code change necessary.
+++
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/util/texture/spi')
-rwxr-xr-x | src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java | 13 | ||||
-rw-r--r-- | src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java | 13 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java b/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java index baa087289..afc6a998e 100755 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java +++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/TextureProvider.java @@ -41,6 +41,7 @@ package com.sun.opengl.util.texture.spi; import java.io.*; import java.net.*; +import javax.media.opengl.GLProfile; import com.sun.opengl.util.texture.*; @@ -58,6 +59,8 @@ public interface TextureProvider { * do any OpenGL-related work. The resulting TextureData can be * converted into an OpenGL texture in a later step. * + * @param glp the OpenGL Profile this texture data should be + * created for. * @param file the file from which to read the texture data * * @param internalFormat the OpenGL internal format to be used for @@ -83,7 +86,7 @@ public interface TextureProvider { * * @throws IOException if an error occurred while reading the file */ - public TextureData newTextureData(File file, + public TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -95,6 +98,8 @@ public interface TextureProvider { * not do any OpenGL-related work. The resulting TextureData can be * converted into an OpenGL texture in a later step. * + * @param glp the OpenGL Profile this texture data should be + * created for. * @param stream the stream from which to read the texture data * * @param internalFormat the OpenGL internal format to be used for @@ -120,7 +125,7 @@ public interface TextureProvider { * * @throws IOException if an error occurred while reading the stream */ - public TextureData newTextureData(InputStream stream, + public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -132,6 +137,8 @@ public interface TextureProvider { * do any OpenGL-related work. The resulting TextureData can be * converted into an OpenGL texture in a later step. * + * @param glp the OpenGL Profile this texture data should be + * created for. * @param url the URL from which to read the texture data * * @param internalFormat the OpenGL internal format to be used for @@ -157,7 +164,7 @@ public interface TextureProvider { * * @throws IOException if an error occurred while reading the URL */ - public TextureData newTextureData(URL url, + public TextureData newTextureData(GLProfile glp, URL url, int internalFormat, int pixelFormat, boolean mipmap, diff --git a/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java b/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java index 0244db285..f025ba591 100644 --- a/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java +++ b/src/jogl/classes/com/sun/opengl/util/texture/spi/awt/IIOTextureProvider.java @@ -44,6 +44,7 @@ import java.awt.image.*; import java.io.*; import java.net.*; import javax.imageio.*; +import javax.media.opengl.GLProfile; import com.sun.opengl.impl.Debug; import com.sun.opengl.util.texture.*; @@ -53,7 +54,7 @@ import com.sun.opengl.util.texture.spi.*; public class IIOTextureProvider implements TextureProvider { private static final boolean DEBUG = Debug.debug("TextureIO"); - public TextureData newTextureData(File file, + public TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, @@ -66,10 +67,10 @@ public class IIOTextureProvider implements TextureProvider { System.out.println("TextureIO.newTextureData(): BufferedImage type for " + file + " = " + img.getType()); } - return new AWTTextureData(internalFormat, pixelFormat, mipmap, img); + return new AWTTextureData(glp, internalFormat, pixelFormat, mipmap, img); } - public TextureData newTextureData(InputStream stream, + public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, @@ -82,17 +83,17 @@ public class IIOTextureProvider implements TextureProvider { System.out.println("TextureIO.newTextureData(): BufferedImage type for stream = " + img.getType()); } - return new AWTTextureData(internalFormat, pixelFormat, mipmap, img); + return new AWTTextureData(glp, internalFormat, pixelFormat, mipmap, img); } - public TextureData newTextureData(URL url, + public TextureData newTextureData(GLProfile glp, URL url, int internalFormat, int pixelFormat, boolean mipmap, String fileSuffix) throws IOException { InputStream stream = url.openStream(); try { - return newTextureData(stream, internalFormat, pixelFormat, mipmap, fileSuffix); + return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix); } finally { stream.close(); } |