[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.1 Mix_AllocateChannels

int Mix_AllocateChannels(int numchans)

numchans
Number of channels to allocate for mixing.
A negative number will not do anything, it will tell you how many channels are currently allocated.

Set the number of channels being mixed. This can be called multiple times, even with sounds playing. If numchans is less than the current number of channels, then the higher channels will be stopped, freed, and therefore not mixed any longer. It's probably not a good idea to change the size 1000 times a second though.
If any channels are deallocated, any callback set by Mix_ChannelFinished will be called when each channel is halted to be freed. Note: passing in zero WILL free all mixing channels, however music will still play.

Returns: The number of channels allocated. Never fails...but a high number of channels can segfault if you run out of memory. We're talking REALLY high!

 
// allocate 16 mixing channels
Mix_AllocateChannels(16);

See Also:
4.1.4 Mix_OpenAudio



This document was generated on November, 13 2009 using texi2html