I’m working on a Winamp visualization plugin which uses SDL for video
output. Everything works the first time I activate the plugin, but when I
reactivate it SDL_Init(SDL_INIT_VIDEO) fails and the error is that it
couldn’t create the window. The same thing happens if I have two different
versions of the plugin and I first run one and then try to run the other
one. I have disabled everything except SDL initialization and cleanup and
this problem still happens.
Everything works if I make a standalone executable. I can restart SDL as
many times as I want from the same program without any problems whatsoever.
The only difference between the standalone program and the Winamp plugin is
that the standalone program has a main function which calls some things
instead of Winamp.
Does anybody have any ideas on what’s going on? Is okay for a program to do
SDL_Init, do some stuff, then do SDL_Quit, then sometimes later do SDL_Init
and start doing stuff again, and so on? Is it okay to use SDL from a DLL?–