Commit graph

5845 commits

Author SHA1 Message Date
thefiddler 21deea87d8 [Linux] Correctly set evdev packet number 2014-09-18 01:20:21 +02:00
thefiddler 129fb81224 [Linux] Implemented evdev joystick polling 2014-09-18 01:20:21 +02:00
thefiddler 397bdda076 [Linux] Implemented evdev joystick device discovery 2014-09-18 01:20:21 +02:00
thefiddler 8642177c30 [Mac] Use DeviceCollection
This reduces code duplication significantly.
2014-09-18 01:16:41 +02:00
thefiddler 2c26df8d93 [Input] Added From* overloads with out parameters 2014-09-18 01:16:40 +02:00
thefiddler 2a6579032e [Mac] Match SDL2 element order
Joystick elements (axes, buttons, hats) are now reported in the same
order as SDL2. This fixes potential mismatches in the GamePad
configuration database.

Additionally, elements are now counted correctly (duplicate elements no
longer count towards the total.)
2014-09-18 01:16:40 +02:00
thefiddler fbedac9a16 [Mac] Fixed Joystick Hat calculations 2014-09-18 01:16:40 +02:00
thefiddler b9f7f2c242 [Mac] Sort joystick elements like SDL2
GamePad configuration database is now working correctly on Mac.
2014-09-18 01:16:40 +02:00
thefiddler 9c67265832 [Mac] Added CFGetTypeID method 2014-09-18 01:16:40 +02:00
thefiddler 4231cf2cdd [Mac] Use cookies to match HID joystick elements 2014-09-18 01:16:40 +02:00
thefiddler d4c6b2e699 [Mac] Fixed joystick Guid calculation
The result now matches the output of SDL2 as well as the entries in the
GamePad configuration database.
2014-09-18 01:16:40 +02:00
thefiddler 41f1f92cdf Merge pull request #161 from thefiddler/win_xinput
[Win] HID-based IJoystickDriver2; improve XInput2 IGamePadDriver
2014-09-18 01:14:50 +02:00
thefiddler 10dd7e8227 [Input] Special-case pre-SDL2.0.4 xinput bindings
Starting with SDL 2.0.4, its xinput bindings are working correctly.
Previous versions would return an invalid zero guid and use incorrect
mapping - this has now been fixed.
2014-09-17 23:48:08 +02:00
thefiddler 4337288d74 [Win] Removed unused code 2014-09-17 18:43:29 +02:00
thefiddler 8237b889c9 [Win] Fixed XInput y-axis and trigger range 2014-09-17 18:42:47 +02:00
thefiddler ea66a828bf [Win] Suppressed spurious warning 2014-09-17 18:42:27 +02:00
thefiddler c29509838d Merge pull request #176 from Robmaister/develop
Added Matrix3[d].Add and Matrix4[d].CreateFromRotationMatrix
2014-09-16 14:17:58 +02:00
thefiddler 73f255ed14 [Input] Fixed bitwise test for GamePadAxes 2014-09-12 10:23:54 +02:00
thefiddler 2df0496c44 [SDL] Correctly byteswap Guid
Fixes an issue where GamePad Guids would fail to be matched with the
Guids in the configuration database.
2014-09-12 08:43:20 +02:00
thefiddler 71e5a4f4f3 [Input] Add GamePadCapabilities.IsMapped 2014-09-12 08:42:26 +02:00
Robert Rouhani 7a4dfcf40d Changed Matrix4[d].CreateFromRotationMatrix to a new constructor. 2014-09-11 12:33:34 -04:00
thefiddler 742149412e [Input] Fixed button/hat->trigger mapping scale 2014-09-11 12:51:50 +02:00
thefiddler 0735700d50 [Input] Added P880 win32 gamepad configuration 2014-09-11 12:51:50 +02:00
thefiddler bf9f7c9479 [Input] Fixed trigger ToString() 2014-09-11 12:51:50 +02:00
thefiddler 6c2a6336b5 [Input] Added missing Back button in ToString() 2014-09-11 12:51:50 +02:00
thefiddler 0d4fddd9b4 [Win] Skip devices with too many axes
These are likely not joysticks / gamepads, but multitouch-capable HID
devices.
2014-09-11 12:51:50 +02:00
thefiddler 388acee32a [Win] Correct joystick GUID generation
Joystick GUIDs now match SDL2/DirectInput for USB devices. (Bluetooth
devices still need to be tested.)
2014-09-11 12:51:49 +02:00
thefiddler ec37a9a16d [Input] Do not throw exception on too many axes
A joystick device with more axes/buttons/hats than supported will now
register a warning message instead of throwing an exception.

Fixes an issue with the VMware touch driver, which registers 25 distinct
axes.
2014-09-11 12:51:49 +02:00
thefiddler f829b3d732 [Win] Fix compilation in Release 2014-09-11 12:51:49 +02:00
thefiddler 8c762e56e3 [Win] Added collection id to dictionary keys 2014-09-11 12:51:49 +02:00
thefiddler a2d6f1801c [Win] Improved joystick debugging information 2014-09-11 12:51:49 +02:00
thefiddler 1e5b2e57cd [Win] Correct XInput axes/button/hat mapping 2014-09-11 12:51:49 +02:00
thefiddler f81046f27d [Win] Corrected GUID for xinput devices 2014-09-11 12:51:49 +02:00
thefiddler 0bd6854a65 [Win] Detect xinput devices and use xinput driver 2014-09-11 12:51:49 +02:00
thefiddler be575d4475 [Win] Refactored UpdateAxes 2014-09-11 12:51:49 +02:00
thefiddler 354fc04614 [Win] Do not change device index when replugging 2014-09-11 12:51:49 +02:00
thefiddler 9efa75179f [Platform] DeviceCollection hardware id is long 2014-09-11 12:51:49 +02:00
thefiddler 4c411b0b6e [Win] Retrieve joystick input even on background 2014-09-11 12:51:48 +02:00
thefiddler dd0f622670 [Win] Do not re-query caps in ProcessEvents
We just do that once when a device is opened.
2014-09-11 12:51:48 +02:00
thefiddler 15a79e5213 [Input] Improved GamePadButtons.ToString() 2014-09-11 12:51:48 +02:00
thefiddler 5c0923004a [Win] Fixed axis, button and hat value updates 2014-09-11 12:51:48 +02:00
thefiddler e3875527eb [Win] Fixed axis range calculation
Values are now correctly scaled between [min, max]
2014-09-11 12:51:48 +02:00
thefiddler f010e32570 [Win] Added HidP status codes 2014-09-11 12:51:48 +02:00
thefiddler cbb2807959 [Win] Implemented joystick button updates
Due to the way we segregate axes from buttons, the easiest approach is
to retrieve the current button state via HidP_GetUsages().

Axes, buttons and hats are now allocated sequentially based on their
order of appearance in the device capability reports.
2014-09-11 12:51:48 +02:00
thefiddler 3fee0bd8d0 [Win] Raw input parsing moved to input drivers 2014-09-11 12:51:48 +02:00
thefiddler a51a85c517 [Win] Added helper raw input methods 2014-09-11 12:51:48 +02:00
thefiddler 6d54edc389 [Win] Use DeviceCollection. Fix GUID detection 2014-09-11 12:51:48 +02:00
thefiddler db01cac895 [Common] Use long for device keys 2014-09-11 12:51:48 +02:00
thefiddler a8aabbf02c [Win] Made internal struct non-public 2014-09-11 12:51:47 +02:00
thefiddler 8fddf8b669 [Win] Fixed axis/button detection
We can now discover button range collections.
2014-09-11 12:51:47 +02:00
thefiddler f3b3b8860e [Win] Improved HidP bindings
Marked arrays with [In] and [Out] as required. Fixes issues with
axis/button capabilities returning empty results.

Added bindings for link collection node transversal.
2014-09-11 12:51:47 +02:00
thefiddler 131de67459 Fixed minor compilation issues 2014-09-11 12:51:47 +02:00
Stefanos A 30d09a4300 [Win] Cleaned up public region 2014-09-11 12:51:47 +02:00
Stefanos A 9a25ddc14d [Win] Corrected GetRawInputData invocation 2014-09-11 12:51:47 +02:00
Stefanos A 97b0275aa4 [Win] Removed WinMM joystick driver 2014-09-11 12:51:47 +02:00
Stefanos A cec48ab20a [Win] Completed raw input IJoystickDriver2
For improved safety, we are now using managed memory buffers instead of
stack allocations and pointers.
2014-09-11 12:51:47 +02:00
Stefanos A f6b382c929 [Win] Reduce duplication in device enumeration 2014-09-11 12:51:47 +02:00
Stefanos A e38fc0dff7 [Input] Added JoystickCapabilities.SetIsConnected 2014-09-11 12:51:47 +02:00
Stefanos A 27e80fcc9e [Win] Completed WinRawJoystick implementation 2014-09-11 12:51:46 +02:00
Stefanos A 956691de31 [Win] Fixed RawHID struct definition 2014-09-11 12:51:46 +02:00
Stefanos A 94476b930e [Common] Moved axis translation to common 2014-09-11 12:51:46 +02:00
Stefanos A 85e6b9f9ad [Win] Wrapped additional HID APIs 2014-09-11 12:51:46 +02:00
Stefanos A 2c197f09e1 [Win] Cleanup Raw Input HID usage/pages 2014-09-11 12:51:46 +02:00
Stefanos A cac96bbaf9 [Common] Cleaned up comments 2014-09-11 12:51:46 +02:00
Stefanos A dc357604df [Win] Added HidProtocol binding 2014-09-11 12:51:46 +02:00
Stefanos A 178305e1c1 [Common] Added HID usage page definitions 2014-09-11 12:51:46 +02:00
Stefanos A 18c02db7b0 [Win] Initial implementation of WinRawJoystick 2014-09-11 12:51:46 +02:00
Stefanos A 9cf3deea8c [Win] Improve WinMM.GetCapabilities performance
Polling joyGetCaps is very very slow, so we should not do that every
time GetCapabilities is called. Instead, we should call joyGetCaps once
and cache the results.

We need to find a different way to implement hotplugging.
2014-09-11 12:51:46 +02:00
Stefanos A c3b289ee9b [Win] Implemented XInput vibration support 2014-09-11 12:51:46 +02:00
Stefanos A 06e63946cc [Win] Separate keyboard/mouse & joystick drivers
Keyboard/mouse support comes through WinRawInput; joystick support
through CombinedJoystickDriver. These drivers are now instantiated
separately.
2014-09-11 12:51:45 +02:00
Stefanos A 5cfde8ff0f [Win] Added combined XInput+WinMM joystick driver
Joystick devices will be queried through XInput first, with a fallback
to WinMM in case they are not recognized by the newer API.
2014-09-11 12:51:45 +02:00
Stefanos A 14d07a5952 [Win] Corrected XInput Guid in gamepad database
All XInput devices expose the same button layout, so they only need a
single entry in the gamepad configuration database.
2014-09-11 12:51:45 +02:00
Stefanos A 765ad9e05b [Win] WinRawInput is IKeyboard/MouseDriver2
Since we do not use Raw Input for joystick devices, it does not make
sense to expose the IJoystickDriver2 interface through WinRawInput. This
keeps allows joystick and keyboard/mouse implementations to reside in
distinct, modular classes, instantiated separately through WinFactory.
2014-09-11 12:51:45 +02:00
Stefanos A 8968f7ff38 [Win] XInputJoystick is now IJoystickDriver2
The IGamePadDriver interface is now implemented using
MappedGamePadDriver on all platforms. This minimizes code duplication
and simplifies all input driver implementations, since we only need
backends for IJoystickDriver2.
2014-09-11 12:51:45 +02:00
Stefanos A 0e72cb3dd2 [OpenTK] Removed unused CreateGraphicsMode API
IPlatformFactory.CreateGraphicsMode is no longer used or required.
2014-09-11 12:51:45 +02:00
thefiddler d6d6842730 Merge pull request #178 from thefiddler/mac_crash
[Mac] Avoid crash when combining with MonoMac/Xamarin.Mac
2014-09-11 12:42:20 +02:00
thefiddler 73fd8aca35 Merge pull request #179 from thefiddler/issue152
[ES][GL] Fix GetObjectLabel marked obsolete
2014-09-11 12:42:12 +02:00
thefiddler 1bba544cbe [ES][GL] Fix GetObjectLabel marked obsolete
Fixes issue #152
2014-09-11 12:34:35 +02:00
thefiddler 6292ad4160 [Mac] Avoid calling finishLaunching multiple times 2014-09-11 12:21:05 +02:00
thefiddler 1080dec04d [Mac] Do not modify existing mainMenu
If an application already has a custom main menu, avoid overwriting
that in OpenTK.
2014-09-11 12:07:53 +02:00
thefiddler 05e40b6f09 Merge pull request #177 from thefiddler/gw_input
[Input] Added GameWindow.Mouse/Keyboard.GetState()
2014-09-11 09:33:07 +02:00
thefiddler c6989395df [Input] Added GameWindow.Mouse/Keyboard.GetState()
GameWindow.Mouse/Keyboard hide OpenTK.Input.Mouse/Keyboard.
To simplify usage, the former now provide the same methods
as the latter.
2014-09-11 01:03:24 +02:00
thefiddler 410c06112a [API] Fixed tests for nested types 2014-09-11 00:00:16 +02:00
thefiddler 978e2ccebb [Convert] Update to v4.5 by default 2014-09-10 23:29:30 +02:00
thefiddler a9f1b90997 [API] Update test to cover extensions 2014-09-10 23:29:15 +02:00
thefiddler 1c76024938 [ES][GL] Maintain compatibility with 1.1.4 2014-09-10 23:29:03 +02:00
Robert Rouhani ee56a3506d Added Matrix3[d].Add and Matrix4[d].CreateFromRotationMatrix 2014-09-09 13:21:11 -04:00
thefiddler 51a11092eb [GL] Sync signatures with OpenGL 4.5 2014-09-03 20:56:43 +02:00
thefiddler b9235e1b4c [Bind] Remove default debug parameter 2014-09-03 20:55:42 +02:00
thefiddler 3805c3ad63 [Bind] Minor debug message beautification 2014-09-03 20:55:25 +02:00
thefiddler a05ffb8654 [Bind] Hardcode some common OpenGL IHV names
These names are present in ES enums, even if no function uses them. We
need them for backwards-compatibility.
2014-09-02 13:04:14 +02:00
thefiddler d036c50a15 [Bind] Use ES/1.1/obsolete.xml 2014-09-02 13:04:14 +02:00
thefiddler 1ef9b85e9a [ES] Moved some ES 1.1 to ES/1.1/obsolete.xml 2014-09-02 13:04:14 +02:00
thefiddler b45e9463fc [GL] Removed duplicate enums
This duplication is no longer necessary, after the enum name
translation fix.
2014-09-02 13:04:14 +02:00
thefiddler 45c8d837a1 [Bind] Added ES 3.1 generator 2014-09-02 13:04:14 +02:00
thefiddler 5ec28b65be [Bind] Do not re-translate translated enum names 2014-09-02 13:04:14 +02:00
thefiddler d50bef3ba6 [GL] Fixed COMPRESSED_SRGB_ALPHA_BPTC_UNORM token 2014-09-02 13:04:14 +02:00
thefiddler 7cd2f0b1e6 [GL] Fixed TEXTURE_BINDING_RECTANGLE token 2014-09-02 13:04:14 +02:00
thefiddler 2410dda9a4 [GL] Removed duplicate bindings 2014-09-02 13:04:14 +02:00
thefiddler bfcfb9a2ce [GL] Added missing VertexAttribDPointerType enum
This enum used to be there, but somehow disappeared from the 4.5 specs.
It’s back now.
2014-09-02 13:04:14 +02:00