summaryrefslogtreecommitdiffstats
path: root/www/devmaster/lesson2.html
diff options
context:
space:
mode:
Diffstat (limited to 'www/devmaster/lesson2.html')
-rw-r--r--www/devmaster/lesson2.html34
1 files changed, 17 insertions, 17 deletions
diff --git a/www/devmaster/lesson2.html b/www/devmaster/lesson2.html
index 91bbb3e..f1b0b2c 100644
--- a/www/devmaster/lesson2.html
+++ b/www/devmaster/lesson2.html
@@ -39,10 +39,10 @@ tutorial from <a href="http://devmaster.net/">DevMaster.net</a> to JOAL.
real quick and easy tutorial. It won't get too much more complicated at this point.</p>
<pre >
<font color="#0000FF">import </font>java.nio.ByteBuffer;
- <font color="#0000FF">import </font>net.java.games.joal.AL;
- <font color="#0000FF">import</font> net.java.games.joal.ALC;
- <font color="#0000FF">import</font> net.java.games.joal.ALFactory;
- <font color="#0000FF">import</font> net.java.games.joal.util.ALut;
+ <font color="#0000FF">import</font> com.jogamp.openal.AL;
+ <font color="#0000FF">import</font> com.jogamp.openal.ALC;
+ <font color="#0000FF">import</font> com.jogamp.openal.ALFactory;
+ <font color="#0000FF">import</font> com.jogamp.openal.util.ALut;
<font color="#0000FF">public</font> <font color="#0000FF">class</font> LoopingAndFadeaway {
@@ -72,7 +72,7 @@ real quick and easy tutorial. It won't get too much more complicated at this poi
<font color="#006600"> // Load wav data into a buffer.</font>
- al.alGenBuffers(1, buffer);
+ al.alGenBuffers(1, buffer, 0);
<font color="#0000FF">if </font>(al.alGetError() != AL.AL_NO_ERROR)
<font color="#0000FF">return</font> AL.AL_FALSE;
ALut.alutLoadWAVFile(
@@ -83,14 +83,14 @@ real quick and easy tutorial. It won't get too much more complicated at this poi
freq,
loop);
al.alBufferData(buffer[0], format[0], data[0], size[0], freq[0]);
- ALut.alutUnloadWAV(format[0], data[0], size[0], freq[0]);
+<!-- ALut.alutUnloadWAV(format[0], data[0], size[0], freq[0]); -->
- al.alGenSources(1, source);
+ al.alGenSources(1, source, 0);
al.alSourcei(source[0], AL.AL_BUFFER, buffer[0]);
al.alSourcef(source[0], AL.AL_PITCH, 1.0f);
al.alSourcef(source[0], AL.AL_GAIN, 1.0f);
- al.alSourcefv(source[0], AL.AL_POSITION, sourcePos);
- al.alSourcefv(source[0], AL.AL_POSITION, sourceVel);
+ al.alSourcefv(source[0], AL.AL_POSITION, sourcePos, 0);
+ al.alSourcefv(source[0], AL.AL_POSITION, sourceVel, 0);
al.alSourcei(source[0], AL.AL_LOOPING, AL.AL_TRUE);
<font color="#0000FF"> if </font>(al.alGetError() != AL.AL_NO_ERROR) {
<font color="#0000FF">return</font> AL.AL_FALSE;
@@ -104,15 +104,15 @@ real quick and easy tutorial. It won't get too much more complicated at this poi
clip has ended.</p>
<pre class=code>
<font color="#0000FF">static <span class=codeKeyword>void</span> </font>setListenerValues() {
- al.alListenerfv(AL.AL_POSITION, listenerPos);
- al.alListenerfv(AL.AL_VELOCITY, listenerVel);
- al.alListenerfv(AL.AL_ORIENTATION, listenerOri);
+ al.alListenerfv(AL.AL_POSITION, listenerPos, 0);
+ al.alListenerfv(AL.AL_VELOCITY, listenerVel, 0);
+ al.alListenerfv(AL.AL_ORIENTATION, listenerOri, 0);
}
<font color="#0000FF">static <span class=codeKeyword>void</span> </font>killALData() {
- al.alDeleteBuffers(1, buffer);
- al.alDeleteSources(1, source);
- Alut.alutExit();
+ al.alDeleteBuffers(1, buffer, 0);
+ al.alDeleteSources(1, source, 0);
+ ALut.alutExit();
}
</pre>
<p>Nothing has changed here.</p>
@@ -130,7 +130,7 @@ real quick and easy tutorial. It won't get too much more complicated at this poi
<font color="#0000FF">long</font> elapsed = 0;
<font color="#0000FF">long</font> ticker = 0;
<font color="#0000FF">long</font> lastTime = 0;
- <font color="#0000FF">while</font> (elapsed < 5000) {
+ <font color="#0000FF">while</font> (elapsed < 10000) {
elapsed = System.currentTimeMillis() - startTime;
<font color="#0000FF">if</font> (ticker > 100) {
ticker = 0;
@@ -140,7 +140,7 @@ real quick and easy tutorial. It won't get too much more complicated at this poi
al.alSourcefv(
source[0],
AL.AL_POSITION,
- sourcePos);
+ sourcePos, 0);
}
ticker += System.currentTimeMillis() - lastTime;
lastTime = System.currentTimeMillis();