Browse Source

Fixing a bug where texture size getter is called before the opengl is initialized.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9337 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Kae..pl 13 years ago
parent
commit
2fe4d620d9
1 changed files with 6 additions and 2 deletions
  1. 6 2
      engine/src/blender/com/jme3/asset/BlenderKey.java

+ 6 - 2
engine/src/blender/com/jme3/asset/BlenderKey.java

@@ -189,7 +189,12 @@ public class BlenderKey extends ModelKey {
 	 */
 	public int getMaxTextureSize() {
 		if(maxTextureSize <= 0) {
-			maxTextureSize = GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE);
+			try {
+				maxTextureSize = GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE);
+			} catch(Exception e) {
+				//this is in case this method was called before openGL initialization
+				return 8192;
+			}
 		}
 		return maxTextureSize;
 	}
@@ -658,7 +663,6 @@ public class BlenderKey extends ModelKey {
 			return lights;
 		}
 
-		@Override
 		public int collideWith(Collidable other, CollisionResults results) throws UnsupportedCollisionException {
 			return 0;
 		}