{
class Sdl2Factory : IPlatformFactory
{
- readonly IInputDriver2 InputDriver = new Sdl2InputDriver();
+ readonly Sdl2InputDriver InputDriver = new Sdl2InputDriver();
bool disposed;
/// <summary>
public INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device)
{
- return new Sdl2NativeWindow(x, y, width, height, title, options, device);
+ return new Sdl2NativeWindow(x, y, width, height, title, options, device, InputDriver);
}
public IDisplayDeviceDriver CreateDisplayDeviceDriver()
// Argument for KeyDown and KeyUp events (allocated once to avoid runtime allocations)
readonly KeyboardKeyEventArgs key_args = new KeyboardKeyEventArgs();
- readonly IInputDriver input_driver = new Sdl2InputDriver();
+ readonly IInputDriver input_driver;
readonly EventFilter EventFilterDelegate_GCUnsafe = FilterEvents;
readonly IntPtr EventFilterDelegate;
static readonly Sdl2KeyMap map = new Sdl2KeyMap();
public Sdl2NativeWindow(int x, int y, int width, int height,
- string title, GameWindowFlags options, DisplayDevice device)
+ string title, GameWindowFlags options, DisplayDevice device,
+ IInputDriver input_driver)
{
lock (sync)
{
+ this.input_driver = input_driver;
+
var bounds = device.Bounds;
var flags = TranslateFlags(options);
flags |= WindowFlags.OPENGL;