diff options
author | Chien Yang <[email protected]> | 2007-03-09 00:58:28 +0000 |
---|---|---|
committer | Chien Yang <[email protected]> | 2007-03-09 00:58:28 +0000 |
commit | 637d8427266fd3108764700b9f95d9a3b03893ff (patch) | |
tree | 29be17c24091efda5589d8bcc8cf84153aa7dd0c /src/native | |
parent | 88d9f0a85c8f8ddcfb758676296b86236cffaa2e (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/native')
-rw-r--r-- | src/native/ogl/Canvas3D.c | 15 | ||||
-rw-r--r-- | src/native/ogl/gldefs.h | 1 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/native/ogl/Canvas3D.c b/src/native/ogl/Canvas3D.c index 2a7cfc1..39d328c 100644 --- a/src/native/ogl/Canvas3D.c +++ b/src/native/ogl/Canvas3D.c @@ -383,6 +383,12 @@ checkTextureExtensions( javax_media_j3d_Canvas3D_TEXTURE_NON_POWER_OF_TWO; } + if (isExtensionSupported(tmpExtensionStr, + "GL_SGIS_generate_mipmap")) { + ctxInfo->textureExtMask |= + javax_media_j3d_Canvas3D_TEXTURE_AUTO_MIPMAP_GENERATION; + } + } @@ -598,8 +604,9 @@ getPropertiesFromCurrentContext( } if (versionNumbers[0] > 1) { - /* OpenGL 2.x -- set flags for 1.3 and 2.0 or greater */ + /* OpenGL 2.x -- set flags for 1.3, 1.4 and 2.0 or greater */ ctxInfo->gl20 = JNI_TRUE; + ctxInfo->gl14 = JNI_TRUE; ctxInfo->gl13 = JNI_TRUE; } else { @@ -647,7 +654,10 @@ getPropertiesFromCurrentContext( ctxInfo->texture_base_level_enum = GL_TEXTURE_BASE_LEVEL; ctxInfo->texture_max_level_enum = GL_TEXTURE_MAX_LEVEL; - + if (ctxInfo->gl14) { + ctxInfo->textureExtMask |= javax_media_j3d_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. @@ -2610,6 +2620,7 @@ initializeCtxInfo(JNIEnv *env , GraphicsContextPropertiesInfo* ctxInfo) ctxInfo->versionNumbers[0] = 1; ctxInfo->versionNumbers[1] = 1; ctxInfo->gl13 = JNI_FALSE; + ctxInfo->gl14 = JNI_FALSE; ctxInfo->gl20 = JNI_FALSE; /* 1.2 and GL_ARB_imaging */ diff --git a/src/native/ogl/gldefs.h b/src/native/ogl/gldefs.h index 1edaeff..edd5cdd 100644 --- a/src/native/ogl/gldefs.h +++ b/src/native/ogl/gldefs.h @@ -434,6 +434,7 @@ struct GraphicsContextPropertiesInfoRec { char *extensionStr; int versionNumbers[2]; jboolean gl13; /* OpenGL 1.3 or greater */ + jboolean gl14; /* OpenGL 1.4 or greater */ jboolean gl20; /* OpenGL 2.0 or greater */ /* GL_ARB_imaging subset */ |