[SDL] sdl mixer, high cpu ussage

Leeor Dicker leeor.net at gmail.com
Sun Apr 26 15:37:38 PDT 2009


> first time i put the mixer lib dll libreries in system32 directory, i 
experienced some problems with winamp and relocated the dll's to my project 
directory, did my system files were hurt?, is this causing my problem?

Not likely although under Win32 you should never install DLL's into your 
System32 directory especially if you're using XP or Vista. These DLL's should 
be under your program's directory only.

As far as your high CPU usage, SDL takes a lot of power to run properly and so 
if you don't limit it it'll take all the CPU usage it needs. In the case of 
your Mixer, it's possible that it's doing on-the-fly conversions to get audio 
to the right formats for playback. Not too familiar with whether or not 
SDL_Mixer does this like SDL does with surfaces.

Ultimately, your game is going to cause your CPU usage to go high -- most games 
do. If it's not killing your app's performance than you're not doing anything 
wrong.

Hope this helps!




More information about the SDL mailing list