Commit graph

1286 commits

Author SHA1 Message Date
Thomas Altenburger
0ab980bfe7 Deactivate screensaver on SDL2 2016-02-25 23:02:01 +01:00
cra0zy
b944d92754 [Linux X11] Fix incorrect window state if it was set while the window was invisible 2016-02-19 18:06:09 +01:00
Thomas Altenburger
b29bc2f534 Fixes keyboard being recognized as 2 HID devices 2016-01-08 13:16:38 +01:00
Thomas Altenburger
8488bb6229 Fix HID WinRaw driver to handle PS4 controller 2016-01-08 11:43:39 +01:00
leezer3
b0dbb7de7f Align whitespace for SDL2 KeypadEnter fix.... 2015-12-05 23:54:42 +00:00
leezer3
a2ece2c9fb Fix: KP_ENTER key missing from SDL2 keymap. 2015-12-04 23:49:15 +00:00
leezer3
df690c6f7b Fix: Insert key not working on Linux, due to typo in X11KeyMap.cs 2015-11-14 22:23:40 +00:00
Fraser Waters
a1cc67c70e [Win32] Fix spurious mouse enter and leave messages
Mouse tracking and mouse capture didn't work well together. Mouse capture was
also buggy in that it could release capture prematurely.

Mouse capture is now counted and tracked better, multiple requests to set
capture will only call SetCapture once. ReleaseCapture will only be called once
the same number of releases have been made as sets.
MW_MOUSELEAVE messages are now ignored if the mouse is captured.
Mouse tracking is renabled when mouse capture is released.
While the mouse is captured enter and leave events are genereated based on
tracking of the mouse inside MouseMove.

Fixes #301
2015-10-17 17:00:41 +01:00
Fraser Waters
d1654d70d5 [X11] Fix CursorVisible
Change X11 CursorVisible to only execute if a change is actually needed,
that is if we're going from visible to not visible or vice versa.

Fixes #281
2015-08-21 23:58:00 +01:00
Dean Ellis
69e2f36725 Removed NO_SYSDRAWING in favour of just MINUMAL
Reverted changes to GLControl.cs
Updated sln to not build OpenTK.GLControl in MINIMAL mode
2015-08-12 11:56:12 +01:00
Dean Ellis
c7e86d467b Fixed MINIMAL and NO_SYSDRAWING compilation 2015-08-12 11:53:20 +01:00
Fraser Waters
3026154989 Merge pull request #289 from Frassle/leak
[Win32] Fix leaks in Win32 Cursor property
2015-08-10 22:01:42 +01:00
Fraser Waters
33c06d4b35 [Win32] Fix leaks in Win32 Cursor property
GetIconInfo
(https://msdn.microsoft.com/en-us/library/windows/desktop/ms648070(v=vs.85).aspx)
creates bitmaps that must be deleted after the call to
CreateIconIndirect, which copies the bitmaps to the icon it creates.

bmpIcon created by Bitmap.GetHicon is now destroyed after being used.

The return value of SetCursor was used to retrieve the last cursor, as
it could have been set by another library (Some UI libraries change the
cursor using the .net Cursor) this could of leaked the cursor we created
and now lost track of. We now delete the handle we had set, not the one
returned by SetCursor.
2015-08-10 21:57:05 +01:00
Marcus Comstedt
f538b93ad3 Fix XIEventMask to work on any architecture
The mask part of an XIEventMask struct is actually not a pointer to an
integer containing the mask, but rather to an array of bytes each
holding 8 bits of the mask, with the first byte holding bit 0-7.
Therefore the old code would only work on little endian arches.
2015-08-08 23:46:18 +02:00
Fraser Waters
e6e8b7a357 Merge pull request #261 from Frassle/resize
X11: Fix so ClientSize can resize windows with fixed borders
2015-05-29 10:40:35 +01:00
Fraser Waters
0fb149f97b X11: Fix so ClientSize can resize windows with fixed borders
Also fixes issue that NativeWindowBase.Height was setting non-client
height but Width was setting client Width. Both now set client size.

Fixes #259
2015-05-12 14:17:16 +01:00
Fraser Waters
29e2876396 [EGL] ANGLE and EXT additions
Adds eglQuerySurfacePointerANGLE and a number of ANGLE related
constants.
Add eglGetPlatformDisplayEXT, eglCreatePlatformWindowSurfaceEXT and
eglCreatePlatformPixmapSurfaceEXT from EGL_EXT_platform_base.
2015-04-21 21:22:29 +01:00
Jonas Boesch
d6779d986d GetStaticAddess checks for RenderableFlags.ES3 2015-04-21 14:36:09 +01:00
Jonas Boesch
f57e411723 Added OPENGL_ES3_BIT 2015-04-21 14:34:35 +01:00
Fraser Waters
a90db72e2d [Windows] Fix detection of KeyboardDivide key
Fixes #237
2015-04-10 23:29:20 +01:00
marko
5953907f86 Allowed Mac and Linux to use GamePad. Added Name param to GamePad. Added Xbox 360 Wireless Joystick linux config to GamePadCongifurationDatabase. 2015-01-19 19:04:59 +01:00
Fraser Waters
2de9c0b907 Fix wrap around bug in XInput.
Fixes #209. 
Negating short.MinValue would cause a wrap around back to short.MinValue. 
This resulted in joystick inputs like 0.8, 0.9, -1.00031.
2015-01-09 12:50:50 +00:00
Fraser Waters
b9cc6fa861 [X11] GetEntryAssembly may be null.
When running under NUnit GetEntryAssembly returns null. In this case we instead
search through the AppDomain for an assembly that matches the AppDomain name.
2014-11-04 23:00:05 +01:00
Fraser Waters
fe3a0df56a Add #pragma warning disable for unused field warnings.
Fixes warnings [#61] by disabling unused field warnings for two structures in
HidProtocol. These fields aren't currently used by OpenTK but the stuctures are
used in native marshalling so must match the documented structures perfectly.
2014-11-03 01:39:45 +01:00
Fraser Waters
41b684491d Remove unused fields/variables.
Fixes warnings [#61] by removing some unused variables and an unused field.
Field was private so no inheritance concerns.
2014-11-03 01:36:36 +01:00
thefiddler
e621b21c88 [Win] Avoid NRE in WinFactory.Dispose()
WinFactory.Dispose() could crash with a NRE when the joystick driver has
not been initialized. Fixed by checking for null before disposing the
input driver.
2014-09-23 08:55:02 +02:00
thefiddler
383cea7e82 [Mac] Fixed exception in HIDInput.Dispose()
HIDInput.Dispose() would remove elements from a DeviceCollection during
iteration. This results in an exception.

We are now using a plain for-loop instead.
2014-09-20 17:11:18 +02:00
thefiddler
747d86bafb [Common] Avoid GC in DeviceCollection
`DeviceCollection.GetEnumerator()` now returns a struct IEnumerable<T>
directly to avoid boxing.

Additionally, we can now use `DeviceCollection[int]` as a shortcut to
`FromIndex(int)`.
2014-09-20 17:10:05 +02:00
thefiddler
2b3a4c578a Merge pull request #181 from thefiddler/evdev
[Linux] Implement evdev joystick driver
2014-09-20 13:53:12 +02:00
thefiddler
179c82387c [Linux] Fixed byteswapping in joystick Guid calculation 2014-09-18 01:20:21 +02:00
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
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
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
thefiddler
742149412e [Input] Fixed button/hat->trigger mapping scale 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