Changeset 255
- Timestamp:
- 04/21/07 07:56:54 (1 year ago)
- Files:
-
- trunk/docs/ft.html (modified) (1 diff)
- trunk/docs/gl.html (modified) (13 diffs)
- trunk/docs/sdl.html (modified) (1 diff)
- trunk/docs/sdlimg.html (modified) (1 diff)
- trunk/docs/sdlmix.html (modified) (1 diff)
- trunk/docs/sdlnet.html (modified) (1 diff)
- trunk/docs/sdlttf.html (modified) (1 diff)
- trunk/docs/styles.css (modified) (1 diff)
- trunk/docs/util.html (modified) (8 diffs)
- trunk/docs/vorbis.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/docs/ft.html
r158 r255 22 22 Windows users. All users should be sure to read the accompnaying NOTES.txt 23 23 in the DerelictFT directory for more information.</div> 24 25 <div class="important">Currently, there is a bug with DMD that prevents26 DerelictFT from compiling when the -debug switch is specified. Because of this,27 the package's forbuild.txt cancels -debug when present. If you build the package28 yourself, without using the Derelict build script, keep that in mind.</div>29 24 30 25 <h3>Using</h3> trunk/docs/gl.html
r233 r255 1 1 <html lang="en"> 2 2 <head> 3 <title>DerelictGL</title>4 <link rel="stylesheet" type="text/css" href="styles.css">3 <title>DerelictGL</title> 4 <link rel="stylesheet" type="text/css" href="styles.css"> 5 5 </head> 6 6 <body> … … 35 35 void main() 36 36 { 37 DerelictGL.load();38 39 // now you can call OpenGL functions37 DerelictGL.load(); 38 39 // now you can call OpenGL functions 40 40 } 41 41 </pre> 42 42 43 43 <div class="note">Return values and parameters of type <tt>GLubyte*</tt>, when 44 in stended to represent a string, have been declared in DerelictGL as <tt>char*</tt>44 intended to represent a string, have been declared in DerelictGL as <tt>char*</tt> 45 45 instead.</div> 46 46 47 47 <p> 48 48 As with other Derelict packages, DerelictGL will throw an exception if an error 49 occurs while loading the shared library. For more information on Derelict 49 occurs while loading the shared library. For more information on Derelict 50 50 exceptions, see the documentation for 51 51 <a href="loading.html">Loading/Unloading Shared Libraries</a>. … … 64 64 an OpenGL application for general public consumption, there is no way to guarantee 65 65 which version of the API will be available on any user's system until the 66 application is actually run on that system. 66 application is actually run on that system. 67 67 </p><p> 68 68 Another issue is presented by … … 71 71 on Windows 95. Furthermore, this DLL is a (rather poor) software implementation. Vista 72 72 ships with the software implementation, but also includes an OpenGL DLL that supports 73 up to core OpenGL 1.4 and is implemented on top of D 3D. This DLL provides hardware73 up to core OpenGL 1.4 and is implemented on top of Direct3D. This DLL provides hardware 74 74 acceleration, but all of the calls first go through a translation layer to convert 75 75 them to D3D calls. The system can load the implementation provided by the … … 102 102 <tt>void DerelictGL.loadVersions(GLVersion minVersion)</tt><br /> 103 103 This method will attempt to load a specific verision of OpenGL. If any version 104 of OpenGL up to and including the version requested fails to load successfully, 104 of OpenGL up to and including the version requested fails to load successfully, 105 105 then this method throws a <span class="bold">SharedLibProcLoadException</span>. 106 106 </p> … … 108 108 Before attempting to load any functions, two checks are made. The first check is 109 109 to determine if an OpenGL context has been made current. If not, this method 110 will throw an <span class="bold">E rror</span>. The method next determines110 will throw an <span class="bold">Exception/span>. The method next determines 111 111 if a check has been made internally for the latest available version supported 112 112 by the driver. If not, that check is made. Only then are the functions loaded. 113 113 </p><p> 114 When this function returns successfully, a call to 114 When this function returns successfully, a call to 115 115 <span class="bold">DerelictGL.availableVersion</span> will return either a value 116 116 greater than or equal to the version you requested to load. If an exception is … … 121 121 <p> 122 122 <tt>GLVersion DerelictGL.availableVersion()</tt><br /> 123 When this method is called, it first checks to determine if the availab el123 When this method is called, it first checks to determine if the available 124 124 version has already been set. If not, it will query the driver for the highest 125 125 version supported and <span class="bold">then will attempt to load each supported 126 126 version</span>. A successful load will result in a return value that indicates 127 127 the highest loaded version. A failure will result in an 128 <span class="bold">E rror</span> if no context is current, or a128 <span class="bold">Exception</span> if no context is current, or a 129 129 <span class="bold">SharedLibProcLoadException</span> if any function failed to 130 130 load. Successive calls will always return the latest loaded version as long … … 134 134 <p> 135 135 <tt>char[] DerelictGL.versionString(GLVersion glv)</tt><br /> 136 Returns the string form of the given version. The format of the string is "Version X.X". 136 Returns the string form of the given version. The format of the string is "Version X.X". 137 137 </p> 138 138 … … 140 140 <tt>bool DerelictGL.hasValidContext()</tt><br /> 141 141 Returns true if a context has been made current. This is used internally before 142 attempting any loads that require an active context, but is also publicly 142 attempting any loads that require an active context, but is also publicly 143 143 available. You may find this useful if you have an application that manages 144 144 multiple OpenGL contexts. … … 153 153 </p> 154 154 <pre> 155 // Example 1: Requesting a specific version. 155 156 import derelict.opengl.gl; 156 157 import derelict.util.exception; … … 158 159 void main() 159 160 { 160 // load OpenGL 1.1 161 DerelictGL.load(); 162 163 // attempt to load every version up to OpenGL 1.5 164 try 165 { 166 } 167 catch(SharedLibProcLoadException slple) 168 { 169 // here, you can check the highest version actually loaded. It is possible 170 // that a version higher than 1.5 caused the exception, in which case 171 // you might choose to continue. If available version is actually 172 // lower than 1.5, you should decide what to do bases on your 173 // application requirements (i.e. if you absolutely require 1.5, abort, 174 // but if not, you might fall back on extensions). Then again, an exception 175 // may likely indicate a big problem with the shared library, in which 176 // case aborting may be the best option no matter what 177 178 /* Do Something Here */ 179 } 180 181 // at this point, you might be satisfied knowing that you have 1.5 available, 182 // or you might want to see if later versions are available 183 GLVersion glv = DerelictGL.availableVersion(); 184 if(glv > 1.5) 185 { 186 /* Do Something Here */ 187 } 161 // load OpenGL 1.1 162 DerelictGL.load(); 163 164 // attempt to load every version up to OpenGL 1.5 165 try 166 { 167 DerelictGL.loadVersions(GLVersion.Version15); 168 } 169 catch(SharedLibProcLoadException slple) 170 { 171 // Here, you can check which is the highest version that actually loaded. 172 173 /* Do Something Here */ 174 } 188 175 } 189 176 </pre> 190 177 191 178 <pre> 179 // Example 2: Loading the highest available version. 192 180 import derelict.opengl.gl; 193 181 import derelict.util.exception; … … 195 183 void main() 196 184 { 197 // load OpenGL 1.1198 DerelictGL.load();199 200 // attempt to load the higest GL version supported by the driver201 GLVersion glv;202 try203 {204 glv = DerelictGL.getAvailableVersion();205 } 206 catch(SharedLibProcLoadException slple)207 {208 // You might want to abort here if you are worried about a corrupt209 // shared library. Otherwise, you'll want to determine what was210 // actually loaded.211 glv = DerelictGL.getAvailableVersion();212 }213 214 switch(glv)215 {216 ...217 }218 185 // load OpenGL 1.1 186 DerelictGL.load(); 187 188 // attempt to load the higest GL version supported by the driver 189 GLVersion glv; 190 try 191 { 192 glv = DerelictGL.getAvailableVersion(); 193 } 194 catch(SharedLibProcLoadException slple) 195 { 196 // You might want to abort here if you are worried about a corrupt 197 // shared library. Otherwise, you'll want to determine what was 198 // actually loaded. 199 glv = DerelictGL.getAvailableVersion(); 200 } 201 202 switch(glv) 203 { 204 ... 205 } 206 219 207 } 220 208 </pre> … … 222 210 <div class="note"> 223 211 It should be noted that Derelict's <a href="selective.html">selective loading 224 mechanism</a> may be used to bypass exceptions in loading versions later than225 1.2. However, it isnot recommended you do so unless there is a very compelling212 mechanism</a> may be used when loading versions later than 1.2. However, it is 213 not recommended you do so unless there is a very compelling 226 214 reason. 227 215 </div> trunk/docs/sdl.html
r157 r255 22 22 in DerelictSDL than it is in SDL. This is because the C version makes use of 23 23 bitfields, which D does not support. Currently, DerelictSDL replaces all bitfields 24 in the structure definition with a single uintfield called <tt>flags</tt>. It is24 in the structure definition with a single <tt>uint</tt> field called <tt>flags</tt>. It is 25 25 still possible to access the individual bitfield flags by using bit manipulation 26 26 operators, but unless you know what you are doing it is recommended that you not trunk/docs/sdlimg.html
r149 r255 48 48 <a href="loading.html">Loading/Unloading Shared Libraries</a>. 49 49 </p> 50 <div class="note">In any module calls SDL_image functions, you will also need50 <div class="note">In any module that calls SDL_image functions, you will also need 51 51 to import derelict.sdl.sdl. This is not required to load the library, as shown 52 52 above.</div> trunk/docs/sdlmix.html
r149 r255 49 49 </p> 50 50 <div class="note"> 51 In any module where you wish to callSDL_mixer functions, you will also need51 In any module that calls SDL_mixer functions, you will also need 52 52 to import derelict.sdl.sdl. This is not required to load the library, as shown 53 53 above.</div> trunk/docs/sdlnet.html
r149 r255 47 47 <a href="loading.html">Loading/Unloading Shared Libraries</a>. 48 48 </p> 49 <div class="note">In any module where you wish to callSDL_net functions, you will also need49 <div class="note">In any module that calls SDL_net functions, you will also need 50 50 to import derelict.sdl.sdl. This is not required to load the library, as shown 51 51 above.</div> trunk/docs/sdlttf.html
r149 r255 47 47 <a href="loading.html">Loading/Unloading Shared Libraries</a>. 48 48 </p> 49 <div class="note">In any module where you wish to callSDL_ttf functions, you will also need49 <div class="note">In any module that calls SDL_ttf functions, you will also need 50 50 to import derelict.sdl.sdl. This is not required to load the library, as shown 51 51 above.</div> trunk/docs/styles.css
r254 r255 77 77 font-weight: bold; 78 78 color: #FF0000; 79 margin-top: .5em; 80 margin-bottom: .5em; 79 81 } 80 82 trunk/docs/util.html
r165 r255 11 11 <hr> 12 12 <h3>Introduction</h3> 13 DerelictUtil currently provides two modules: <tt>derelict.util.exception</tt> and 14 <tt>derelict.util.loader</tt>. The former provides optional functionality that 15 the client can use to make an application as robust as possible, while the latter 16 is intended primarily for internal use by the Derelict packages. Regardless of 17 whether or not the client imports any modules from DerelictUtil, the other 18 Derelict packages all have an implicit dependency upon DerelictUtil. As such, when 19 building an application that uses Derelict, the DerelictUtil library must be linked 20 to the application. 13 DerelictUtil contains four modules. Of these, two are intended exlusively for 14 internal use. Of the other two, one, <tt>derelict.util.exception</tt>, provides 15 optional functionality that the client can use to make an application as robust 16 as possible. The other, <tt>derelict.util.loader</tt> is primarily intended for 17 internal use but may be useful for anyone needing to manually load a shared 18 library in their application. Regardless of whether or not the client imports 19 any modules from DerelictUtil, the other Derelict packages all have an implicit 20 dependency upon DerelictUtil. As such, when building an application that uses 21 Derelict, the DerelictUtil library must be linked to the application. 21 22 22 23 <h3>The Exception Module</h3> … … 24 25 you must import <tt>derelict.util.exception</tt>. It defines three exception types 25 26 that can be thrown when a shared library fails to load, and also defines the 26 interface for <a href="selective.html">selective symbol exceptions</a>.27 interface for <a href="selective.html">selective symbol loading</a>. 27 28 28 29 <p><hr></p><p> … … 33 34 that matches the name returned by the <tt>sharedLibName</tt> property of this 34 35 exception.</p> 35 36 36 37 <p><tt>SharedLibProcLoadException</tt><br> 37 38 This exception is thrown when a symbol cannot be loaded from a shared library. 38 39 This might indicate that the library is corrupt, or that it is a different version 39 than what wasexpected. In other words, the library exists on the system, but40 than expected. In other words, the library exists on the system, but 40 41 no symbol that matches the name returned by the <tt>procName</tt> property of 41 42 this exception could be found. In some cases, it may be desirable to prevent this 42 exception from being thrown. You can learn how by reading about 43 <a href="selective.html">Selective Symbol Exceptions</a>.</p>43 exception from being thrown. You can learn how by reading about 44 <a href="selective.html">Selective Symbol Loading</a>.</p> 44 45 45 46 <p><tt>InvalidSharedLibHandleException</tt><br> … … 52 53 This function allows the client to set a callback that will be called when a 53 54 symbol cannot be found in a shared library. The name of the library will be passed 54 to the callback in the <tt>libName</tt> parameter , and the name of the missing55 symbol i s in the <tt>procName</tt> parameter. The client can use these parameters55 to the callback in the <tt>libName</tt> parameter and the name of the missing 56 symbol in the <tt>procName</tt> parameter. The client can use these parameters 56 57 to determine if Derelict should continue loading the shared library. If so, then 57 58 the callback should return true. If Derelict should abort loading and throw an exception, 58 59 the callback should return false. Note that the callback must be set before loading 59 60 the library(ies) you are interested in. You can read more about this feature in 60 the <a href="selective.html">Selective Symbol Exceptions</a> documentation.</p>61 the <a href="selective.html">Selective Symbol Loading</a> documentation.</p> 61 62 <p><hr></p> 62 63 … … 64 65 <tt>derelict.util.loader</tt> provides a common interface for Derelict packages 65 66 to load shared libraries. You should generally only use this module if you are 66 creating a new package for inclusion in Derelict. However, it DerelictUtil can 67 be used as a standalone package if you so desire, perhaps as a replacement for 67 creating a new package for inclusion in Derelict. However, it is useful if you 68 need to load other shared libraries in your Derelict application. Also, 69 DerelictUtil can be used as a standalone package, perhaps as a replacement for 68 70 <tt>std.loader</tt>. 69 71 70 72 <p><hr></p><p> 71 73 <tt>SharedLib Derelict_LoadSharedLib(char[] libName)</tt><br> 72 Opens a handle to a shared library, and returns a reference handle of type 73 <tt>SharedLib</tt>. This handle is used by other functions in this module to 74 manipulate the shared library. If the library cannot be loaded for some reason, 75 a <tt>SharedLibLoadException</tt> is thrown.</p> 74 Opens and returns a shared library handle of type <tt>SharedLib</tt>. This handle 75 is used by other functions in this module to manipulate the shared library. If 76 the library cannot be loaded, a <tt>SharedLibLoadException</tt> is thrown.</p> 76 77 77 <p><tt> >SharedLib Derelict_LoadSharedLib(char[][] libNames)</tt><br>78 <p><tt>SharedLib Derelict_LoadSharedLib(char[][] libNames)</tt><br> 78 79 Given an array of shared library names, returns a handle to the first shared 79 80 library successfully loaded. This is intended for use on platforms where a single … … 82 83 load, an exception is thrown for the last library name.</p> 83 84 84 <p><tt> <void* Derelict_GetProc(SharedLib lib, char[] procName)</tt><br>85 <p><tt>void* Derelict_GetProc(SharedLib lib, char[] procName)</tt><br> 85 86 Given a handle to a shared library and the name of a symbol, this function loads 86 87 the symbol from the shared library into memory and returns a pointer to it. This … … 88 89 the symbol cannot be found, this function first checks if a <tt>MissingProcCallback</tt> 89 90 has been set and, if so, calls it. Otherwise a <tt>SharedLibProcLoadException</tt> 90 is thrown. If the shared library referenced by the handle has already been 91 is thrown. If the shared library referenced by the handle has already been 91 92 unloaded, an <tt>InvalidSharedLibHandleException</tt> is thrown.</p> 92 93 … … 94 95 Unloads a shared library from memory. The library handle will no longer be valid. 95 96 Attempts to use it again could cause an <tt>InvalidSharedLibHandleException</tt> to 96 be thrown. However, if an invalid shared library handle is passe sto this function,97 be thrown. However, if an invalid shared library handle is passed to this function, 97 98 no exception is thrown and the function is a no-op. 98 99 </body> trunk/docs/vorbis.html
r157 r255 12 12 <h3>Introduction</h3> 13 13 <p>DerelictVorbis is a D binding to Xiph.org's <a href="http://www.xiph.org/vorbis"> 14 Ogg Vorbis codec</a>. Vorbis is a compres ed audio format similar to mp3, but14 Ogg Vorbis codec</a>. Vorbis is a compressed audio format similar to mp3, but 15 15 allows smaller filesizes with the same level of audio quality and is also 16 16 patent-free and open source.</p>
