Hi guys.
I am absolutely totally and in all ways green to everything 3D and LWJGL. That aside, I have nearly as much experience as you can get with Java2D and a large part of Java itself, so I’m not a noob coder in general.
In any case - I recently downloaded LWJGL, installed it on my computer, and am trying to figure it out from the feeble tutorials I’ve located on the net. I just downloaded Space Invaders by Kevin Glass (from CVS), put the source code into a new project, imported everything, put it all in the right folders etc. etc., and sounds do not work.
Here is the error that pops up:
Use -fullscreen for fullscreen mode
java.io.IOException: Stream closed
at java.io.BufferedInputStream.ensureOpen(BufferedInputStream.java:120)
at java.io.BufferedInputStream.read(BufferedInputStream.java:199)
at java.io.DataInputStream.readInt(DataInputStream.java:443)
at com.sun.media.sound.WaveFileReader.getFMT(WaveFileReader.java:244)
at com.sun.media.sound.WaveFileReader.getAudioInputStream(WaveFileReader.java:160)
at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:710)
at org.lwjgl.util.WaveData.create(WaveData.java:93)
at SoundManager.addSound(SoundManager.java:153)
at Game.initialize(Game.java:241)
at Game.<init>(Game.java:178)
at Game.main(Game.java:579)
Exception in thread "main" java.lang.NullPointerException
at SoundManager.addSound(SoundManager.java:156)
at Game.initialize(Game.java:241)
at Game.<init>(Game.java:178)
at Game.main(Game.java:579)
By commenting out various things and looking through the code I’m guessing that it is having some issue streaming the sound file into useable data. I have the sounds in the same folder as the images, which do work. Help would be appreciated.
I personally learn everything I know from looking at source code, so as long as I can get this to work I should be on my merry way.
PS - Is there any reason to convert my game from Java2D to OpenGL 2D? A comparatively small amount of images can make even my G5 choke when using Java2D, and because OpenGL gives direct hardware access I assume it’s faster. Is it reasonable to waste my time doing this?
Thank you very much, guys!