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