diff --git a/src/FNAPlatform.cs b/src/FNAPlatform.cs index 2f9f020..757bfd9 100644 --- a/src/FNAPlatform.cs +++ b/src/FNAPlatform.cs @@ -38,7 +38,6 @@ namespace Microsoft.Xna.Framework CreateWindow = SDL2_FNAPlatform.CreateWindow; DisposeWindow = SDL2_FNAPlatform.DisposeWindow; - BeforeInitialize = SDL2_FNAPlatform.BeforeInitialize; RunLoop = SDL2_FNAPlatform.RunLoop; CreateGLDevice = SDL2_FNAPlatform.CreateGLDevice; CreateALDevice = SDL2_FNAPlatform.CreateALDevice; @@ -84,9 +83,6 @@ namespace Microsoft.Xna.Framework public delegate void DisposeWindowFunc(GameWindow window); public static readonly DisposeWindowFunc DisposeWindow; - public delegate void BeforeInitializeFunc(); - public static readonly BeforeInitializeFunc BeforeInitialize; - public delegate void RunLoopFunc(Game game); public static readonly RunLoopFunc RunLoop; diff --git a/src/Game.cs b/src/Game.cs index a6e83d9..4c8eb52 100644 --- a/src/Game.cs +++ b/src/Game.cs @@ -820,7 +820,6 @@ namespace Microsoft.Xna.Framework graphicsDeviceManager.CreateDevice(); } - FNAPlatform.BeforeInitialize(); Initialize(); /* We need to do this after virtual Initialize(...) is called. diff --git a/src/SDL2/SDL2_FNAPlatform.cs b/src/SDL2/SDL2_FNAPlatform.cs index f80e6ca..25be231 100644 --- a/src/SDL2/SDL2_FNAPlatform.cs +++ b/src/SDL2/SDL2_FNAPlatform.cs @@ -72,6 +72,19 @@ namespace Microsoft.Xna.Framework "1" ); } + + // We want to initialize the controllers ASAP! + SDL.SDL_Event[] evt = new SDL.SDL_Event[1]; + SDL.SDL_PumpEvents(); + while (SDL.SDL_PeepEvents( + evt, + 1, + SDL.SDL_eventaction.SDL_GETEVENT, + SDL.SDL_EventType.SDL_CONTROLLERDEVICEADDED, + SDL.SDL_EventType.SDL_CONTROLLERDEVICEADDED + ) == 1) { + INTERNAL_AddInstance(evt[0].cdevice.which); + } } public static void ProgramExit(object sender, EventArgs e) @@ -401,22 +414,6 @@ namespace Microsoft.Xna.Framework game.Exit(); } - public static void BeforeInitialize() - { - // We want to initialize the controllers ASAP! - SDL.SDL_Event[] evt = new SDL.SDL_Event[1]; - SDL.SDL_PumpEvents(); // Required to get OSX device events this early. - while (SDL.SDL_PeepEvents( - evt, - 1, - SDL.SDL_eventaction.SDL_GETEVENT, - SDL.SDL_EventType.SDL_CONTROLLERDEVICEADDED, - SDL.SDL_EventType.SDL_CONTROLLERDEVICEADDED - ) == 1) { - INTERNAL_AddInstance(evt[0].cdevice.which); - } - } - public static IGLDevice CreateGLDevice( PresentationParameters presentationParameters ) {