root/branches/Derelict2/doc/sfml_window.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>DerelictSFMLWindow</title>
4     <link rel="stylesheet" type="text/css" href="styles.css">
5 </head>
6 <body>
7 <h2>DerelictSFMLWindow</h2>
8 DerelictSFMLWindow is a D binding to the SFML Window library that ships with <a href="http://www.sfml-dev.org/">SFML 1.6</a>.
9
10 <h3>Building</h3>
11 To compile DerelictSFMLWindow, add the <tt>DerelictSFMLWindow</tt> make target to the command line when
12 compiling Derelict. For example, to build DerelictSFMLWindow on Windows with DMD, you would execute the following:
13 <pre><code>
14 make -fwin32.mak DerelictSFMLWindow 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 DerelictSFMLWindow, you will need to import the
24 <tt>derelict.sfml.window</tt> module.</li>
25 <li>You must link your application with the DerelictSFMLSystem, DerelictSFMLWindow and DerelictUtil libraries.</li>
26 <li>Before calling any SFML Window functions, you need to make a call to <tt>DerelictSFMLWindow.load</tt>.
27 This will load the shared library.</li>
28 </ol>
29
30 <p>
31 The following is a complete program that loads DerelictSFMLWindow:
32 </p>
33
34 <pre><code>
35 import derelict.sfml.window;
36
37 void main()
38 {
39     DerelictSFMLWindow.load();
40
41     // now you can call SFML Window functions
42 }
43 </code></pre>
44 <p>
45 As with other Derelict bindings, DerelictSFMLWindow 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>DerelictSFMLWindow.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 DerelictSFMLWindow 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.