root/branches/Derelict2/doc/al.html

Revision 616, 2.2 kB (checked in by aldacron, 4 months ago)

[Derelict2]
* updated mime-type on all the documentation

  • Property svn:mime-type set to text/html
Line 
1 <html lang="en">
2 <head>
3     <title>DerelictAL</title>
4     <link rel="stylesheet" type="text/css" href="styles.css">
5 </head>
6 <body>
7 <h2>DerelictAL</h2>
8 DerelictAL is a D binding to <a href="http://connect.creativelabs.com/openal/default.aspx">OpenAL</a>,
9 a cross-platform 3D audio API.
10 <p>
11 The current version of DerelictAL requires <tt>OpenAL 1.1</tt> or later.</a>
12 </p>
13
14 <h3>Building</h3>
15 To compile DerelictAL, add the <tt>DerelictAL</tt> make target to the command line when
16 compiling Derelict. For example, to build DerelictAL on Windows with DMD, you would execute the following:
17 <pre><code>
18 make -fwin32.mak DerelictAL DC=DMD
19 </code></pre>
20 For more information on compiling Derelict libraries, see <a href="build.html">Building the
21 Derelict Bindings</a>.
22
23 <h3>Using</h3>
24 <ol>
25 <li>Always make sure the DerelictAL source modules are available on your import
26 path.</li>
27 <li>In modules that make use of DerelictAL, you will need to import the
28 <tt>derelict.openal.al</tt> module.</li>
29 <li>You must link your application with the DerelictAL and DerelictUtil libraries.</li>
30 <li>Before calling any OpenAL functions, you need to make a call to <tt>DerelictAL.load</tt>.
31 This will load the shared library.</li>
32 </ol>
33
34 <p>
35 The following is a complete program that loads DerelictAL:
36 </p>
37
38 <pre><code>
39 import derelict.openal.al;
40
41 void main()
42 {
43     DerelictAL.load();
44
45     // now you can call OpenAL functions
46 }
47 </code></pre>
48 <p>
49 As with other Derelict bindings, DerelictAL will throw an exception if an error
50 occurs while loading the shared library. For more information on Derelict
51 exceptions, see the documentation for <a href="use.html#Exceptions">Using the Derelict Bindings</a>.
52 </p>
53
54 <p>
55 Finally, the method <tt>DerelictAL.unload()</tt> is provided for convenience. In normal
56 practice you do not need to call this function, as Derelict will unload the library
57 automatically when the app exits. You generally should only use this function if
58 you need to unload DerelictAL while the application is running or if you disable the
59 automatic unloading of shared libraries (as per <a href="util.html#Loader">the documentation for the loader module</a>).
60 </p>
61
62 </body>
63 </html>
Note: See TracBrowser for help on using the browser.