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