From 2fe4d620d95dc922466fc6feed519993a0dfe746 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Mon, 30 Apr 2012 17:37:59 +0000 Subject: [PATCH] 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 --- engine/src/blender/com/jme3/asset/BlenderKey.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/src/blender/com/jme3/asset/BlenderKey.java b/engine/src/blender/com/jme3/asset/BlenderKey.java index f7e67999e..94079f169 100644 --- a/engine/src/blender/com/jme3/asset/BlenderKey.java +++ b/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; }