mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 16:25:37 +00:00
6d0b5eb49f
This is a new platform that can be used then sdl2 is installed on the target system. SDL2 is commercially supported by Valve and provides better support for MacOS compared to our current implementation (Cocoa vs Carbon). It will also help us introduce faster support for new platforms. Existing platforms remain as a fallback and will be automatically used if sdl2 is not installed. Please note that this is still a work in progress. The new mouse and keyboard API is not supported yet. Due to limitations of sdl2, multiple mice/keyboards are also not supported.
64 lines
1.3 KiB
C#
64 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using OpenTK.Input;
|
|
|
|
namespace OpenTK.Platform.SDL2
|
|
{
|
|
class Sdl2InputBase : IInputDriver2
|
|
{
|
|
Sdl2WindowInfo window;
|
|
readonly Thread thread;
|
|
readonly AutoResetEvent ready = new AutoResetEvent(false);
|
|
|
|
public Sdl2InputBase()
|
|
{
|
|
window = new Sdl2WindowInfo(
|
|
SDL.SDL_CreateWindow("Hidden Input Window", 0, 0, 1, 1,
|
|
SDL.SDL_WindowFlags.SDL_WINDOW_HIDDEN),
|
|
null);
|
|
}
|
|
|
|
#region Private Members
|
|
|
|
void ProcessEvents()
|
|
{
|
|
SDL.SDL_Event e;
|
|
while (SDL.SDL_WaitEvent(out e) != 0)
|
|
{
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region IInputDriver2 Members
|
|
|
|
public IMouseDriver2 MouseDriver
|
|
{
|
|
get
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
|
|
public IKeyboardDriver2 KeyboardDriver
|
|
{
|
|
get
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
|
|
public IGamePadDriver GamePadDriver
|
|
{
|
|
get
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|
|
|