From 1856fc92c798ef83af1fc8695eaf060122dd18ca Mon Sep 17 00:00:00 2001 From: Chien Yang Date: Wed, 28 Feb 2007 23:35:03 +0000 Subject: 1) OGL and JOGL only : Fix to Issue 415 : Need ability to disable NPOT textures for raster/background 2) Minor fix on when to call setHasMultiSample(). At present this method is not called, but getHasMultiSample() is used. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@781 ba19aa83-45c5-6ac9-afd3-db810772062c --- src/native/ogl/Canvas3D.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/native/ogl') diff --git a/src/native/ogl/Canvas3D.c b/src/native/ogl/Canvas3D.c index 345da07..f1dac23 100644 --- a/src/native/ogl/Canvas3D.c +++ b/src/native/ogl/Canvas3D.c @@ -376,9 +376,9 @@ checkTextureExtensions( ctxInfo->textureExtMask |= javax_media_j3d_Canvas3D_TEXTURE_LOD_OFFSET; } - - if (isExtensionSupported(tmpExtensionStr, - "GL_ARB_texture_non_power_of_two")) { + + if (isExtensionSupported(tmpExtensionStr, "GL_ARB_texture_non_power_of_two") && + !getJavaBoolEnv(env, "enforcePowerOfTwo")) { ctxInfo->textureNonPowerOfTwoAvailable = JNI_TRUE; ctxInfo->textureExtMask |= javax_media_j3d_Canvas3D_TEXTURE_NON_POWER_OF_TWO; @@ -650,10 +650,12 @@ getPropertiesFromCurrentContext( /* look for OpenGL 2.0 features */ - if (ctxInfo->gl20) { - ctxInfo->textureNonPowerOfTwoAvailable = JNI_TRUE; - ctxInfo->textureExtMask |= - javax_media_j3d_Canvas3D_TEXTURE_NON_POWER_OF_TWO; + if (ctxInfo->gl20) { + if (!getJavaBoolEnv(env, "enforcePowerOfTwo")) { + ctxInfo->textureNonPowerOfTwoAvailable = JNI_TRUE; + ctxInfo->textureExtMask |= + javax_media_j3d_Canvas3D_TEXTURE_NON_POWER_OF_TWO; + } } /* check extensions for remaining of 1.1 and 1.2 */ -- cgit v1.2.3