In StandardGame when I reinit() because the resolution has changed it cleans up the sound and then re-inits the sound. I'm getting this exception when reinit occurs:
java.lang.UnsatisfiedLinkError: org.lwjgl.openal.AL10.nalListener3f(IFFF)V
at org.lwjgl.openal.AL10.nalListener3f(Native Method)
at org.lwjgl.openal.AL10.alListener3f(AL10.java:675)
at com.jmex.audio.openal.OpenALEar.update(OpenALEar.java:61)
at com.jmex.audio.Ear.trackOrientation(Ear.java:106)
at com.jmex.game.StandardGame.initSound(StandardGame.java:256)
at com.jmex.game.StandardGame.reinit(StandardGame.java:331)
at com.jmex.game.StandardGame$1.call(StandardGame.java:338)
at com.jme.util.GameTask.invoke(GameTask.java:101)
at com.jme.util.GameTaskQueue.execute(GameTaskQueue.java:115)
at com.jmex.game.StandardGame.update(StandardGame.java:296)
at com.jmex.game.StandardGame.run(StandardGame.java:188)
at java.lang.Thread.run(Unknown Source)
I would think it would be that OpenAL is missing, but it initialized the first time...
Huh, that's pretty bizzare. I haven't seen anything like that. Perhaps you have a mismatch of jar and native files that's almost but not quite right?
That still doesn't make any sense though because why would it work the first time through but on reinit it dies? You can replicate this issue if you call reinit() in StandardGame.
It didn't work on the second time because lwjgl unloads the driver when AL is destroyed. I've fixed things so jme will know to explicitly recreate.
Awesome, I'll give this a try tomorrow and verify it works.
On a related note, I would like to make the reinit() work in StandardGame so it will properly re-display. It works for the most part except textures disappear. Is there anything I can do (apart from manually reloading all those textures) to make it reload those textures into memory? I believe this has to do with the textures being cleared out of the video memory?
I'm not really in a position atm to dive into StandardGame for you, but if reinit is doing anything like telling TextureManager to clean up, or destroying the Display, then yes, those textures must be reloaded.
Are references to the textures that have been loaded into the video memory kept? I think changing video modes clears out the memory…I don't think I'm doing anything explicitly to cause it except recreating the graphical context.
If references are kept we could create a "reload" method that would reload those textures into video memory?