table of contents
- experimental 3~git20250302~78a2035+ds-1
Mix_ReserveChannels(3) | SDL_mixer3 FUNCTIONS | Mix_ReserveChannels(3) |
NAME¶
Mix_ReserveChannels - Reserve the first channels for the application.
HEADER FILE¶
Defined in SDL3_mixer/SDL_mixer.h
SYNOPSIS¶
#include "SDL3_mixer/SDL_mixer.h"
int Mix_ReserveChannels(int num);
DESCRIPTION¶
While SDL_mixer will use up to the number of channels allocated by
Mix_AllocateChannels (), this sets channels aside that will not be available when calling Mix_PlayChannel
with a channel of -1 (play on the first unused channel). In this case, SDL_mixer will treat reserved channels as "used" whether anything is playing on them at the moment or not.
This is useful if you've budgeted some channels for dedicated audio and the rest are just used as they are available.
Calling this function will set channels 0 to n-1 to be reserved. This will not change channel allocations. The number of reserved channels will be clamped to the current number allocated.
By default, no channels are reserved.
FUNCTION PARAMETERS¶
- num
- number of channels to reserve, starting at index zero.
RETURN VALUE¶
Returns the number of reserved channels.
AVAILABILITY¶
This function is available since SDL_mixer 3.0.0.
SDL_mixer 3.0.0 | SDL_mixer |