[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: |
Schrober |
Subject: |
Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (Was: State of SDL2 in MXE) |
Date: |
Tue, 25 Jun 2013 12:58:57 +0200 |
User-agent: |
KMail/4.10.4 (Linux/3.9-1-amd64; KDE/4.10.4; x86_64; ; ) |
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
--
Franz Schrober
sdl2.mk
Description: Text document
sdl2-1-revert_cd5516b9263d_init_check.patch
Description: Text Data
- [Mingw-cross-env-list] State of SDL2 in MXE, Schrober, 2013/06/23
- Message not available
- Re: [Mingw-cross-env-list] State of SDL2 in MXE, Schrober, 2013/06/24
- Re: [Mingw-cross-env-list] State of SDL2 in MXE, Martin Gerhardy, 2013/06/25
- Re: [Mingw-cross-env-list] State of SDL2 in MXE, Schrober, 2013/06/25
- Re: [Mingw-cross-env-list] State of SDL2 in MXE, Martin Gerhardy, 2013/06/25
- Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (Was: State of SDL2 in MXE), Schrober, 2013/06/25
- Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (Was: State of SDL2 in MXE),
Schrober <=
- Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (Was: State of SDL2 in MXE), Martin Gerhardy, 2013/06/25
- Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (Was: State of SDL2 in MXE), Schrober, 2013/06/25
- Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (Was: State of SDL2 in MXE), Martin Gerhardy, 2013/06/25
- Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (Was: State of SDL2 in MXE), Schrober, 2013/06/25