DerelictSDLMixer
Introduction
DerelictSDLMixer is a D binding to Sam Lantinga's
SDL_mixer, a cross
platform, multichannel, audio mixer library designed to be used together with
SDL.
This version of DerelictSDLMixer requires SDL_mixer 1.2.7 or later.
Using
- Always make sure the DerelictSDLMixer source modules are available on your import
path.
- In modules that make use of DerelictSDLMixer, you will need to import the
derelict.SDLMixer.SDLMixer module.
- Before calling any SDLMixer functions, you need to make a call to DerelictSDLMixer.load().
This will load the shared library.
The following is a complete program that loads DerelictSDLMixer:
import derelict.sdl.mixer;
void main()
{
DerelictSDLMixer.load();
// now you can call SDL_mixer functions
}
As with other Derelict packages, DerelictSDLMixer will throw an exception if an error
occurs while loading the shared library. For more information on Derelict
exceptions, see the documentation for
Loading/Unloading Shared Libraries.
In any module that calls SDL_mixer functions, you will also need
to import derelict.sdl.sdl. This is not required to load the library, as shown
above.
Finally, the method DerelictSDLMixer.unload() is provided for convenience. In normal
practice you do not need to call this function, as Derelict will unload the library
automatically when the app exits. You generally should only use this function if
you need to unload DerelictSDL while the application is running.
Dependencies
DerelictUtil
DerelictSDL