From 637d8427266fd3108764700b9f95d9a3b03893ff Mon Sep 17 00:00:00 2001 From: Chien Yang Date: Fri, 9 Mar 2007 00:58:28 +0000 Subject: 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 --- src/native/ogl/Canvas3D.c | 15 +++++++++++++-- src/native/ogl/gldefs.h | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/native') 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 */ -- cgit v1.2.3