summaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/utils/TextureProvider.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-01-07 01:13:44 +0000
committerKenneth Russel <[email protected]>2006-01-07 01:13:44 +0000
commita295d66a868c897b71104f3dd4c94601c7463840 (patch)
treeaa73f2c18fc0d343724d747eb0142d5213749579 /src/classes/com/sun/opengl/utils/TextureProvider.java
parentc7c06d846e217bff8deac1914cd18cf8b3b6d6c4 (diff)
Fixed mipmap handling in TextureIO and associated classes. Top-level
mipmap argument is now a boolean indicating whether mipmaps should be generated or used if available. Added mipmap argument to newTexture APIs. Added support for reading mipmaps from files which support them, in particular DDS files. Updated TestTexture demo to generate mipmaps. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@521 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/utils/TextureProvider.java')
-rwxr-xr-xsrc/classes/com/sun/opengl/utils/TextureProvider.java36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/classes/com/sun/opengl/utils/TextureProvider.java b/src/classes/com/sun/opengl/utils/TextureProvider.java
index 4b71ae982..fcc62c894 100755
--- a/src/classes/com/sun/opengl/utils/TextureProvider.java
+++ b/src/classes/com/sun/opengl/utils/TextureProvider.java
@@ -58,9 +58,6 @@ public interface TextureProvider {
*
* @param file the file from which to read the texture data
*
- * @param mipmapLevel the mipmap level of the resulting texture being
- * read (FIXME: needs rethinking, not yet working)
- *
* @param internalFormat the OpenGL internal format to be used for
* the texture, or 0 if it should be inferred
* from the file's contents
@@ -69,6 +66,13 @@ public interface TextureProvider {
* the texture, or 0 if it should be inferred
* from the file's contents
*
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ *
* @param fileSuffix the file suffix to be used as a hint to the
* provider to more quickly decide whether it
* can handle the file, or null if the
@@ -78,9 +82,9 @@ public interface TextureProvider {
* @throws IOException if an error occurred while reading the file
*/
public TextureData newTextureData(File file,
- int mipmapLevel,
int internalFormat,
int pixelFormat,
+ boolean mipmap,
String fileSuffix) throws IOException;
/**
@@ -91,9 +95,6 @@ public interface TextureProvider {
*
* @param stream the stream from which to read the texture data
*
- * @param mipmapLevel the mipmap level of the resulting texture being
- * read (FIXME: needs rethinking, not yet working)
- *
* @param internalFormat the OpenGL internal format to be used for
* the texture, or 0 if it should be inferred
* from the file's contents
@@ -102,6 +103,13 @@ public interface TextureProvider {
* the texture, or 0 if it should be inferred
* from the file's contents
*
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ *
* @param fileSuffix the file suffix to be used as a hint to the
* provider to more quickly decide whether it
* can handle the file, or null if the
@@ -111,9 +119,9 @@ public interface TextureProvider {
* @throws IOException if an error occurred while reading the stream
*/
public TextureData newTextureData(InputStream stream,
- int mipmapLevel,
int internalFormat,
int pixelFormat,
+ boolean mipmap,
String fileSuffix) throws IOException;
/**
@@ -124,9 +132,6 @@ public interface TextureProvider {
*
* @param url the URL from which to read the texture data
*
- * @param mipmapLevel the mipmap level of the resulting texture being
- * read (FIXME: needs rethinking, not yet working)
- *
* @param internalFormat the OpenGL internal format to be used for
* the texture, or 0 if it should be inferred
* from the file's contents
@@ -135,6 +140,13 @@ public interface TextureProvider {
* the texture, or 0 if it should be inferred
* from the file's contents
*
+ * @param mipmap whether mipmaps should be produced for this
+ * texture either by autogenerating them or
+ * reading them from the file. Some file formats
+ * support multiple mipmaps in a single file in
+ * which case those mipmaps will be used rather
+ * than generating them.
+ *
* @param fileSuffix the file suffix to be used as a hint to the
* provider to more quickly decide whether it
* can handle the file, or null if the
@@ -144,8 +156,8 @@ public interface TextureProvider {
* @throws IOException if an error occurred while reading the URL
*/
public TextureData newTextureData(URL url,
- int mipmapLevel,
int internalFormat,
int pixelFormat,
+ boolean mipmap,
String fileSuffix) throws IOException;
}