mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (


From: Martin Gerhardy
Subject: Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (Was: State of SDL2 in MXE)
Date: Tue, 25 Jun 2013 13:33:11 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Am 25.06.2013 12:58, schrieb Schrober:
On Tuesday 25 June 2013 12:34:07 Schrober wrote:
Hm, now I have the problem that I cannot initialize subsystems from loaded
plugins in SDL2 anymore when using MXE (cannot test MSVC).

     if(SDL_InitSubSystem(SDL_INIT_AUDIO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK
| SDL_INIT_HAPTIC | SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) {
         fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
         return 1;
     }

works in the SDL_main function. But when done from a loaded DLL (plugin) it
just says:

"Unable to create Helper Window Class: Class already exists."

or (depending on whether using SDL_InitSubSystem/SDL_Init)

"Application didn't initialize properly, did you include SDL_main.h in the
file containing your main() function?"

It worked fine in the past with SDL1.2 and works fine with SDL2 under linux.
The plugin was loaded with LoadLibrary+GetProcAddress and compiled with
i686- w64-mingw32-gcc from mxe 8e7faf84df19346635ffff6c78cabc6a3d4afbc1.

So, I am now completely unsure how I should fix the SDL_MainIsReady from the
view of the plugins. Maybe, if the SDL gurus don't know: MXE is compiling
everything as static libraries. This maybe doesn't work on windows when the
state of SDL should have been shared between main program and plugin. But
now it is impossible to write a plugin with SDL support because I cannot
initialize the subsystems
Just as info for the developers: This regression was introduced in rev
cd5516b9263d - reverting it fixes the problem for me. Attached are both files
Doesn't a call of SDL_SetMainReady do the trick?

Regards
Martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]