aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes
diff options
context:
space:
mode:
authorChien Yang <[email protected]>2007-03-09 00:58:28 +0000
committerChien Yang <[email protected]>2007-03-09 00:58:28 +0000
commit637d8427266fd3108764700b9f95d9a3b03893ff (patch)
tree29be17c24091efda5589d8bcc8cf84153aa7dd0c /src/classes
parent88d9f0a85c8f8ddcfb758676296b86236cffaa2e (diff)
Added support to query GL_SGIS_generate_mipmap and GL_VERSION_1_4 (OpenGL only).
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@790 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes')
-rw-r--r--src/classes/jogl/javax/media/j3d/JoglPipeline.java18
-rw-r--r--src/classes/share/javax/media/j3d/Canvas3D.java7
2 files changed, 24 insertions, 1 deletions
diff --git a/src/classes/jogl/javax/media/j3d/JoglPipeline.java b/src/classes/jogl/javax/media/j3d/JoglPipeline.java
index a6a134a..a8d6db5 100644
--- a/src/classes/jogl/javax/media/j3d/JoglPipeline.java
+++ b/src/classes/jogl/javax/media/j3d/JoglPipeline.java
@@ -8248,6 +8248,11 @@ class JoglPipeline extends Pipeline {
gl.isExtensionAvailable("GL_ARB_texture_non_power_of_two")) {
cv.textureExtendedFeatures |= Canvas3D.TEXTURE_NON_POWER_OF_TWO;
}
+
+ if (gl.isExtensionAvailable("GL_SGIS_generate_mipmap")) {
+ cv.textureExtendedFeatures |= Canvas3D.TEXTURE_AUTO_MIPMAP_GENERATION;
+ }
+
}
@@ -8407,10 +8412,12 @@ class JoglPipeline extends Pipeline {
}
boolean gl20 = false;
+ boolean gl14 = false;
boolean gl13 = false;
if (major > 1) {
// OpenGL 2.x -- set flags for 1.3 and 2.0 or greater
gl20 = true;
+ gl14 = true;
gl13 = true;
} else {
if (minor == 2) {
@@ -8422,8 +8429,15 @@ class JoglPipeline extends Pipeline {
if (gl20) {
assert gl13;
+ assert gl14;
assert gl.isExtensionAvailable("GL_VERSION_2_0");
}
+
+ if (gl14) {
+ assert gl13;
+ assert gl.isExtensionAvailable("GL_VERSION_1_4");
+ }
+
if (gl13) {
assert gl.isExtensionAvailable("GL_VERSION_1_3");
}
@@ -8434,6 +8448,10 @@ class JoglPipeline extends Pipeline {
// Note that we don't query for GL_ARB_imaging here
cv.textureExtendedFeatures |= Canvas3D.TEXTURE_LOD_RANGE;
+
+ if (gl14) {
+ cv.textureExtendedFeatures |= Canvas3D.TEXTURE_AUTO_MIPMAP_GENERATION;
+ }
// look for OpenGL 2.0 features
// Fix to Issue 455 : Need to disable NPOT textures for older cards that claim to support it.
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java
index 8981551..fd3be9b 100644
--- a/src/classes/share/javax/media/j3d/Canvas3D.java
+++ b/src/classes/share/javax/media/j3d/Canvas3D.java
@@ -767,7 +767,8 @@ public class Canvas3D extends Canvas {
// if Texture interpolation mode is support.
static final int TEXTURE_LERP = 0x4000;
static final int TEXTURE_NON_POWER_OF_TWO = 0x8000;
-
+ static final int TEXTURE_AUTO_MIPMAP_GENERATION = 0x10000;
+
int textureExtendedFeatures = 0;
// Extensions supported by the underlying canvas
@@ -3726,6 +3727,10 @@ public class Canvas3D extends Canvas {
values.add(new Boolean(
(textureExtendedFeatures & TEXTURE_NON_POWER_OF_TWO) != 0));
+ keys.add("textureAutoMipMapGenerationAvailable");
+ values.add(new Boolean(
+ (textureExtendedFeatures & TEXTURE_AUTO_MIPMAP_GENERATION) != 0));
+
keys.add("textureCoordSetsMax");
values.add(new Integer(maxTexCoordSets));