summaryrefslogtreecommitdiffstats
path: root/www/devmaster/lesson6.html
diff options
context:
space:
mode:
Diffstat (limited to 'www/devmaster/lesson6.html')
-rw-r--r--www/devmaster/lesson6.html24
1 files changed, 12 insertions, 12 deletions
diff --git a/www/devmaster/lesson6.html b/www/devmaster/lesson6.html
index ed4ee9b..4590cd7 100644
--- a/www/devmaster/lesson6.html
+++ b/www/devmaster/lesson6.html
@@ -122,12 +122,12 @@ public static int </font>loadALBuffer(String path) <font color="#0000FF">throws<
our code will be up to date with later versions.</p>
<pre class=code><font color="#0000FF">public</font> String getALCErrorString(<font color="#0000FF">int</font> err) {
<span class=codeKeyword><font color="#0000FF">switch</font></span>(err) {
- <span class=codeKeyword><font color="#0000FF">case</font></span> ALC_NO_ERROR: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_NO_ERROR";
-<span class=codeKeyword> <font color="#0000FF">case</font></span> ALC_INVALID_DEVICE: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_INVALID_DEVICE";
-<span class=codeKeyword> <font color="#0000FF">case</font></span> ALC_INVALID_CONTEXT: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_INVALID_CONTEXT";
-<span class=codeKeyword> <font color="#0000FF">case</font></span> ALC_INVALID_ENUM: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_INVALID_ENUM";
-<span class=codeKeyword> <font color="#0000FF">case</font></span> ALC_INVALID_VALUE: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_INVALID_VALUE";
-<span class=codeKeyword> <font color="#0000FF">case</font></span> ALC_OUT_OF_MEMORY: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_OUT_OF_MEMORY";
+ <span class=codeKeyword><font color="#0000FF">case</font></span> ALC.ALC_NO_ERROR: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_NO_ERROR";
+<span class=codeKeyword> <font color="#0000FF">case</font></span> ALC.ALC_INVALID_DEVICE: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_INVALID_DEVICE";
+<span class=codeKeyword> <font color="#0000FF">case</font></span> ALC.ALC_INVALID_CONTEXT: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_INVALID_CONTEXT";
+<span class=codeKeyword> <font color="#0000FF">case</font></span> ALC.ALC_INVALID_ENUM: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_INVALID_ENUM";
+<span class=codeKeyword> <font color="#0000FF">case</font></span> ALC.ALC_INVALID_VALUE: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_INVALID_VALUE";
+<span class=codeKeyword> <font color="#0000FF">case</font></span> ALC.ALC_OUT_OF_MEMORY: <span class=codeKeyword><font color="#0000FF">return</font></span> "ALC_OUT_OF_MEMORY";
<font color="#0000FF">default</font>: <font color="#0000FF">return</font> <font color="#0000FF">null</font>;
}
}
@@ -155,7 +155,7 @@ public static int </font>loadALBuffer(String path) <font color="#0000FF">throws<
int result;
<span class=codeComment><font color="#006600">// Generate a buffer. Check that it was created successfully.</font></span>
- al.alGenBuffers(1, buffer);
+ al.alGenBuffers(1, buffer, 0);
<span class=codeKeyword><font color="#0000FF">if</font> </span>((result = al.alGetError()) != AL.AL_NO_ERROR)
<span class=codeKeyword><font color="#0000FF">throw</font></span><font color="#0000FF"> new</font> IOException(getALErrorString(result));
@@ -173,9 +173,9 @@ public static int </font>loadALBuffer(String path) <font color="#0000FF">throws<
<span class=codeKeyword><font color="#0000FF">if</font> </span>((result = al.alGetError()) != AL.AL_NO_ERROR)
<span class=codeKeyword><font color="#0000FF">throw</font></span> new IOException(getALErrorString(result));
-<font color="#006600"> <span class=codeComment>// Get rid of the temporary data.</span>
+<!-- <font color="#006600"> <span class=codeComment>// Get rid of the temporary data.</span>
</font>
- ALut.alutUnloadWAV(format[0], data[0], size[0], freq[0]);
+ ALut.alutUnloadWAV(format[0], data[0], size[0], freq[0]); -->
<span class=codeKeyword><font color="#0000FF">if</font> </span>((result = al.alGetError()) != AL.AL_NO_ERROR)
<span class=codeKeyword><font color="#0000FF">throw</font></span> new IOException(getALErrorString(result));
@@ -237,7 +237,7 @@ public static int </font>loadALBuffer(String path) <font color="#0000FF">throws<
buffer = getLoadedALBuffer(path);
<span class=codeComment><font color="006600">// Generate a source.</font></span>
- al.alGenSources(1, source);
+ al.alGenSources(1, source, 0);
<span class=codeKeyword><font color="000066">if</font> </span>((result = al.alGetError()) != AL.AL_NO_ERROR)
<span class=codeKeyword><font color="0000ff">throw</font></span> new IOException(getALErrorString(result));
@@ -247,8 +247,8 @@ public static int </font>loadALBuffer(String path) <font color="#0000FF">throws<
al.alSourcei (source[0], AL.AL_BUFFER, buffer );
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_VELOCITY, sourceVel);
+ al.alSourcefv(source[0], AL.AL_POSITION, sourcePos, 0);
+ al.alSourcefv(source[0], AL.AL_VELOCITY, sourceVel, 0);
al.alSourcei (source[0], AL.AL_LOOPING, loop ? AL.AL_TRUE : AL.AL_FALSE );
<span class=codeComment>// Save the source id.</span>