SDL -микшер протекает память при игре быстроC++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 SDL -микшер протекает память при игре быстро

Сообщение Anonymous »

Я работаю над созданием обертки для микшера SDL 2 и SDL 2. Я использую SDL 2.0.22 и SDL Mixer 2.8.1. < /P>
Моя обертка может успешно воспроизводить звуки, но проблемы начинаются, как только звуки воспроизводятся в последовательности.

Код: Выделить всё

void playSound( const std::string & category,
const std::string & soundName,
const std::string & whenChannelsBusy = "return" )
{
//Check: Is the category and soundName combo a persistently loaded sound?
if( stevensSound::isPersistentlyStored( category, soundName ) )
{
//If so, play the preloaded sound
stevensSound::playPersistentSound( category, soundName, whenChannelsBusy );
return;
}
//Also check: is the category and soundName combo an existing sound in the 2D sounds map?
else if( !stevensSound::soundsContains( category, soundName ) )
{
//If not, print an error and return
std::string errorMsg = "stevensSound::playSound() error, requested to play sound with category \"" + category + "\" and name \""
+ soundName + "\", but no such sound matching the category and name exists in stevensSound::sounds";
std::cout  

Подробнее здесь: [url]https://stackoverflow.com/questions/79573895/sdl-mixer-leaking-memory-upon-playing-sounds-quickly[/url]
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»