Though these are broken and error prone, as they ignore the possibility
of conflicts between SDL, SDL2 and wrappers thereof discarding useful
include path prefix (SDL2/), since SDL and satellite libraries follow
these it's too hard to stay away.
So don't use prefixes for SDL include paths any longer.
Though documentation and even a comment at the start of Mix_FreeChunk()
state that it's unsafe to free chunk which is still being played, the
function actually contains the code to stop all playback of a chunk which is
being freed. See SDL2_mixer 2.0.0, mixer.c:759:
/* Guarantee that this chunk isn't playing */
SDL_LockAudio();
if ( mix_channel ) {
for ( i=0; i<num_channels; ++i ) {
if ( chunk == mix_channel[i].chunk ) {
mix_channel[i].playing = 0;
mix_channel[i].looping = 0;
}
}
}
SDL_UnlockAudio();
As a result, no special actions are required to stop Mixer playback
before destruction of the Chunks (which is a common case with SDL2pp,
as Chunks may only be constructed after Mixer is created, and are
correspondingly destroyed in reverse order, e.g. before Mixer).
Now it explicitely stores name of SDL function which caused an error
and generates complete user-readable error message which contains both
function name and SDL error message. Users can now handle SDL2pp
exceptions along with all others in `catch (std::exception&)' and
get complete error info.
While here, fixed incorrect function names in some throw's
It's not that large (even smaller than our example .wav file), has
liberal license and saves us from complexity of finding system
font. Later I may consider installing it as a default font to make
ttf features of SDL2pp usable out-of-box without need for extra
fonts.