[SDL] Loading music data from files or buffers

Nikos Chantziaras realnc at arcor.de
Thu Apr 15 12:01:59 PDT 2010


On 04/15/2010 09:55 PM, David Olofson wrote:
>[...]
>> My application is written in Qt, and it seems SDL
>> results in some very weird behavior (for example Qt menus and buttons
>> will stop working at random points).  Googling this, I discovered that
>> SDL uses some form of internal event loop and can't be integrated easily
>> with GUI applications that provide their own event loop, which is a
>> shame since I only need SDL for sound, not graphics (I used Phonon
>> before, but it sucks hard.)
>
> This is the standard problem whenever you want to mix two GUI toolkits, or
> even things remotely similar to GUI toolkits... Most of them want take over
> the application's main loop and handle input and "dispatching" themselves.
>
> However, you should be able to use SDL audio without firing up the SDL event
> system. SDL_Init(SDL_INIT_VIDEO) only, and you should be fine, I think...

You probably meant "SDL_Init(SDL_INIT_AUDIO) only".  Which is what I'm 
doing, but there are still problems, especially on Mac OS X where SDL 
wants to bring Cocoa into the application which is actually Carbon based.

Anyway, it seems SDL isn't what I require in the first place: a 
cross-platform audio decoding, mixing and playing library.  Not that SDL 
isn't awesome in its own right; it's just that it isn't suitable it 
seems for this use case.  I only wish FMOD wasn't closed source and a 
pain in the bum to distribute. :P




More information about the SDL mailing list