I know, you guys are probably getting tired of all my questions already… but I'm really interested in using jME2 for my next project (so long as I can get all the kinks worked out).
I'm developing on a Mac Pro, and I get this error about once in every 10 to 15 runs:
Invalid memory access of location 1e97d003 eip=928b5fc5
The code is simple - load a texture, and stick it on a quad:
package mainGame;
import java.util.concurrent.Callable;
import com.jme.image.Texture;
import com.jme.math.Vector3f;
import com.jme.scene.Spatial.LightCombineMode;
import com.jme.scene.shape.Quad;
import com.jme.scene.state.TextureState;
import com.jme.system.DisplaySystem;
import com.jme.util.GameTaskQueueManager;
import com.jme.util.TextureManager;
import com.jmex.editors.swing.settings.GameSettingsPanel;
import com.jmex.game.StandardGame;
import com.jmex.game.state.GameStateManager;
public class MainGame {
StandardGame game;
/**
* Main entry point of the application
*/
public static void main(String[] args) {
System.setProperty("jme.stats", "set");
MainGame app = new MainGame();
app.begin();
}
public MainGame() {
}
public void begin() {
// Instantiate StandardGame
game = new StandardGame("A Simple Test");
// Show settings screen
try {
GameSettingsPanel.prompt(game.getSettings());
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// Start StandardGame, it will block until it has initialized successfully, then return
game.start();
GameTaskQueueManager.getManager().update(new Callable<Void>(){
public Void call() throws Exception {
PlayState gameState = new PlayState("Play");
GameStateManager.getInstance().attachChild(gameState);
gameState.setActive(true);
TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
Texture t = TextureManager.loadTexture(MainGame.class.getClassLoader()
.getResource("images/bigpictest.png"),
Texture.MinificationFilter.Trilinear, Texture.MagnificationFilter.Bilinear);
t.setWrap(Texture.WrapMode.Clamp);
t.setTranslation(new Vector3f());
ts.setTexture(t);
Quad q = new Quad("image",t.getImage().getWidth(),t.getImage().getHeight());
q.setLocalTranslation(0,0,-975f);
q.setLightCombineMode(LightCombineMode.Off);
gameState.getRootNode().attachChild(q);
q.setRenderState(ts);
q.updateRenderState();
return null;
}
});
}
}
I'm experimenting with big texture support, so the texture is pretty large. I've also tried standardizing the texture size to powers of 2, but it didn't help.