fna-workbench

fna-workbench Commit Details


Date:2016-03-07 08:03:40 (8 years 9 months ago)
Author:Ethan Lee
Branch:master
Commit:6273c3309a475d83c421f1cb2b0626d54552dd93
Parents: e84edf3e38a4d9203854b9ef1ec1f276702476e3
Message:Initialize controllers even sooner!

Changes:

File differences

src/FNAPlatform.cs
3838
3939
4040
41
4241
4342
4443
......
8483
8584
8685
87
88
89
9086
9187
9288
CreateWindow =SDL2_FNAPlatform.CreateWindow;
DisposeWindow =SDL2_FNAPlatform.DisposeWindow;
BeforeInitialize =SDL2_FNAPlatform.BeforeInitialize;
RunLoop =SDL2_FNAPlatform.RunLoop;
CreateGLDevice =SDL2_FNAPlatform.CreateGLDevice;
CreateALDevice =SDL2_FNAPlatform.CreateALDevice;
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;
src/Game.cs
820820
821821
822822
823
824823
825824
826825
graphicsDeviceManager.CreateDevice();
}
FNAPlatform.BeforeInitialize();
Initialize();
/* We need to do this after virtual Initialize(...) is called.
src/SDL2/SDL2_FNAPlatform.cs
7272
7373
7474
75
76
77
78
79
80
81
82
83
84
85
86
87
7588
7689
7790
......
401414
402415
403416
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420417
421418
422419
"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)
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
) {

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.05984s using 13 queries.