| 9 | | Please note that the Linux version is not yet implemented. Anyone who would like |
|---|
| 10 | | to do so please let me know in the forum! |
|---|
| 11 | | |
|---|
| 12 | | Additionally, when distributing applications built with DerelictSDL on Windows, |
|---|
| 13 | | it is a good idea to use the DLL in the DerelictSDL\sdl_dist directory. If you |
|---|
| 14 | | absolutely must distribute a different version of the DLL, please ensure that |
|---|
| 15 | | it is compiled with a compiler that does not mangle the exported DLL funtion |
|---|
| 16 | | symbol names (such as Microsoft Visual C++), or that aliases are used in the |
|---|
| 17 | | DLL's .def file to get around the mangling. Some compilers (such as MingW) will |
|---|
| 18 | | mangle the names in such a way that DerelictSDL cannot load them (at this time). |
|---|
| | 9 | This version of DerelictSDL expects requires SDL 1.2.7 or later. |
|---|
| 57 | | -------------------------------------------------------------------------------- |
|---|
| 58 | | USING SDL_image |
|---|
| 59 | | -------------------------------------------------------------------------------- |
|---|
| 60 | | SDL_image is now incorporated into DerelictSDL. Because SDL_image has a dependency |
|---|
| 61 | | upon SDL, it cannot be used in isolation. To use SDL_image with your SDL application, |
|---|
| 62 | | you first must import the derelict.sdl.image module. |
|---|
| 63 | | |
|---|
| 64 | | ++++++++++++++++++++++++++ CODE +++++++++++++++++++++++++++++++++++++++++++++ |
|---|
| 65 | | |
|---|
| 66 | | import derelict.sdl.image; |
|---|
| 67 | | |
|---|
| 68 | | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|---|
| 69 | | |
|---|
| 70 | | Before calling any SDL_image functions, you need to make a call to |
|---|
| 71 | | DerelictSDLImage_Load. This will load the shared library. |
|---|
| 72 | | |
|---|
| 73 | | ++++++++++++++++++++++++++ CODE +++++++++++++++++++++++++++++++++++++++++++++ |
|---|
| 74 | | |
|---|
| 75 | | // load the shared library - the try...catch block is optional of course |
|---|
| 76 | | try |
|---|
| 77 | | { |
|---|
| 78 | | DerelictSDLImage_Load(); |
|---|
| 79 | | } |
|---|
| 80 | | catch(Exception e) |
|---|
| 81 | | { |
|---|
| 82 | | ... |
|---|
| 83 | | } |
|---|
| 84 | | |
|---|
| 85 | | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|---|
| 86 | | |
|---|
| 87 | | From that point you can call SDL_image functions as normal. Don't forget to make |
|---|
| 88 | | sure that SDL_image.dll is on the path. |
|---|
| 89 | | |
|---|
| 90 | | -------------------------------------------------------------------------------- |
|---|
| 91 | | USING SDL_mixer |
|---|
| 92 | | -------------------------------------------------------------------------------- |
|---|
| 93 | | SDL_mixer is now incorporated into DerelictSDL. Because SDL_mixer has a dependency |
|---|
| 94 | | upon SDL, it cannot be used in isolation. To use SDL_mixer with your SDL application, |
|---|
| 95 | | you first must import the derelict.sdl.mixer module. |
|---|
| 96 | | |
|---|
| 97 | | ++++++++++++++++++++++++++ CODE +++++++++++++++++++++++++++++++++++++++++++++ |
|---|
| 98 | | |
|---|
| 99 | | import derelict.sdl.mixer; |
|---|
| 100 | | |
|---|
| 101 | | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|---|
| 102 | | |
|---|
| 103 | | Before calling any SDL_mixer functions, you need to make a call to |
|---|
| 104 | | DerelictSDLImage_Load. This will load the shared library. |
|---|
| 105 | | |
|---|
| 106 | | ++++++++++++++++++++++++++ CODE +++++++++++++++++++++++++++++++++++++++++++++ |
|---|
| 107 | | |
|---|
| 108 | | // load the shared library - the try...catch block is optional of course |
|---|
| 109 | | try |
|---|
| 110 | | { |
|---|
| 111 | | DerelictSDLMixer_Load(); |
|---|
| 112 | | } |
|---|
| 113 | | catch(Exception e) |
|---|
| 114 | | { |
|---|
| 115 | | ... |
|---|
| 116 | | } |
|---|
| 117 | | |
|---|
| 118 | | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|---|
| 119 | | |
|---|
| 120 | | From that point you can call SDL_mixer functions as normal. Don't forget to make |
|---|
| 121 | | sure that SDL_mixer.dll is on the path. |
|---|
| 122 | | |
|---|
| 123 | | NOTE: to play .ogg files with SDL_mixer you will need the libvorbis DLL from |
|---|
| 124 | | http://www.vorbis.com/ |
|---|
| 125 | | |
|---|
| 126 | | NOTE: to play .mp3 files with SDL_mixer you will need the SMPEG DLL from |
|---|
| 127 | | http://icculus.org/smpeg/ |
|---|
| 128 | | |
|---|
| 129 | | SPECIAL THANKS: to Jaymz031602 for putting the SDL_mixer binding together |
|---|
| | 47 | ******************************************************************************** |
|---|
| | 48 | IMPORTANT |
|---|
| | 49 | ******************************************************************************** |
|---|
| | 50 | DerelictSDL_Load attempts to load the SDL shared library using a filename appropriate |
|---|
| | 51 | for the Operating System. On Windows, this is SDL.dll, and on Linux, libSDL.so. |
|---|
| | 52 | The appropriate shared library (or symlink on Linux) must be on the path for it |
|---|
| | 53 | to be loaded successfully. |
|---|
| 144 | | -------------------------------------------------------------------------------- |
|---|
| 145 | | To build DerelictSDL with SDL_image on Windows: |
|---|
| 146 | | |
|---|
| 147 | | 1) ensure that both dmd\bin and dm\bin are on your path |
|---|
| 148 | | 2) from a command prompt, cd to <derelict_dir>\DerelictSDL |
|---|
| 149 | | 3) type 'make sdl_sdlimg' to build derelictSDL.lib with SDL_image |
|---|
| 150 | | 4) optionally type 'make clean' to delete all object files OR |
|---|
| 151 | | optionally type 'make cleanall' to delete all object and lib files |
|---|
| 152 | | |
|---|
| 153 | | -------------------------------------------------------------------------------- |
|---|
| 154 | | To build DerelictSDL with SDL_mixer on Windows: |
|---|
| 155 | | |
|---|
| 156 | | 1) ensure that both dmd\bin and dm\bin are on your path |
|---|
| 157 | | 2) from a command prompt, cd to <derelict_dir>\DerelictSDL |
|---|
| 158 | | 3) type 'make sdl_sdlmix' to build derelictSDL.lib with SDL_mixer |
|---|
| 159 | | 4) optionally type 'make clean' to delete all object files OR |
|---|
| 160 | | optionally type 'make cleanall' to delete all object and lib files |
|---|
| 161 | | |
|---|
| 162 | | -------------------------------------------------------------------------------- |
|---|
| 163 | | To build DerelictSDL without SDL_image or SDL_mixer on Windows: |
|---|
| 164 | | |
|---|
| 165 | | 1) ensure that both dmd\bin and dm\bin are on your path |
|---|
| 166 | | 2) from a command prompt, cd to <derelict_dir>\DerelictSDL |
|---|
| 167 | | 3) type 'make sdlonly' to build derelictSDL.lib without SDL_image or SDL_mixer |
|---|
| 168 | | 4) optionally type 'make clean' to delete all object files OR |
|---|
| 169 | | optionally type 'make cleanall' to delete all object and lib files |
|---|
| | 71 | 1) ensure that both dmd and gcc are on your path |
|---|
| | 72 | 2) from a command prompt, cd to <derelict_dir>/DerelictSDL |
|---|
| | 73 | 3) type 'make -fMakefule.linux' or 'make -fMakefule.linux all' to build libderelictSDL.a |
|---|
| | 74 | 4) optionally type 'make -fMakefule.linux clean' to delete all object files OR |
|---|
| | 75 | optionally type 'make -fMakefule.linux cleanall' to delete all object and lib files |
|---|