Fixes a minor threading problem and removes useless imports

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9896 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
jul..om 13 years ago
parent e4d776ae0e
commit b76bffcd2f
  1. 5
      engine/src/jogl/com/jme3/renderer/jogl/JoglRenderer.java
  2. 32
      engine/src/jogl/com/jme3/system/jogl/JoglDisplay.java

@ -61,8 +61,6 @@ import com.jme3.texture.Image;
import com.jme3.texture.Texture; import com.jme3.texture.Texture;
import com.jme3.texture.Texture.WrapAxis; import com.jme3.texture.Texture.WrapAxis;
import com.jme3.util.BufferUtils; import com.jme3.util.BufferUtils;
import com.jme3.util.IntMap;
import com.jme3.util.IntMap.Entry;
import com.jme3.util.ListMap; import com.jme3.util.ListMap;
import com.jme3.util.NativeObjectManager; import com.jme3.util.NativeObjectManager;
import com.jme3.util.SafeArrayList; import com.jme3.util.SafeArrayList;
@ -73,12 +71,9 @@ import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.media.opengl.GL; import javax.media.opengl.GL;
import javax.media.opengl.GL2; import javax.media.opengl.GL2;
import javax.media.opengl.GL2ES1;
import javax.media.opengl.GL2ES2; import javax.media.opengl.GL2ES2;
import javax.media.opengl.GL2GL3; import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLContext; import javax.media.opengl.GLContext;
import javax.media.opengl.fixedfunc.GLLightingFunc;
import javax.media.opengl.fixedfunc.GLPointerFunc;
import jme3tools.converters.MipMapGenerator; import jme3tools.converters.MipMapGenerator;
import jme3tools.shader.ShaderDebug; import jme3tools.shader.ShaderDebug;

@ -272,26 +272,30 @@ public class JoglDisplay extends JoglAbstractDisplay {
} }
public void create(boolean waitFor){ public void create(boolean waitFor){
try { if (SwingUtilities.isEventDispatchThread()) {
if (waitFor){ initInEDT();
try{ } else {
SwingUtilities.invokeAndWait(new Runnable() { try {
if (waitFor) {
try {
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
initInEDT();
}
});
} catch (InterruptedException ex) {
listener.handleError("Interrupted", ex);
}
} else {
SwingUtilities.invokeLater(new Runnable() {
public void run() { public void run() {
initInEDT(); initInEDT();
} }
}); });
} catch (InterruptedException ex) {
listener.handleError("Interrupted", ex);
} }
}else{ } catch (InvocationTargetException ex) {
SwingUtilities.invokeLater(new Runnable() { throw new AssertionError(); // can never happen
public void run() {
initInEDT();
}
});
} }
} catch (InvocationTargetException ex) {
throw new AssertionError(); // can never happen
} }
} }

Loading…
Cancel
Save