mixPlayMusic function
Play a new music object.
This will schedule the music object to begin mixing for playback.
There is only ever one music object playing at a time; if this is called when another music object is playing, the currently-playing music is halted and the new music will replace it.
Please note that if the currently-playing music is in the process of fading out (via Mix_FadeOutMusic()), this function will block until the fade completes. If you need to avoid this, be sure to call Mix_HaltMusic() before starting new music.
\param music the new music object to schedule for mixing. \param loops the number of loops to play the music for (0 means "play once and stop"). \returns true on success or false on failure; call SDL_GetError() for more information.
\since This function is available since SDL_mixer 3.0.0.
extern SDL_DECLSPEC bool SDLCALL Mix_PlayMusic(Mix_Music *music, int loops)
Implementation
bool mixPlayMusic(Pointer<MixMusic> music, int loops) {
final mixPlayMusicLookupFunction = libSdl3Mixer.lookupFunction<
Uint8 Function(Pointer<MixMusic> music, Int32 loops),
int Function(Pointer<MixMusic> music, int loops)>('Mix_PlayMusic');
return mixPlayMusicLookupFunction(music, loops) == 1;
}