thefiddler
9ba21d6017
[Win] Implemented modifier keys
2014-02-25 01:13:45 +01:00
thefiddler
09f9bb3a17
[SDL2] Implemented modifier keys
...
Additionally, removed event watch callback in favor of calling
PollEvent() directly in ProcessEvents, which should be more efficient.
2014-02-25 01:13:45 +01:00
thefiddler
0c262cd5b2
[SDL2] Added PeepEvents/PollEvent functions
2014-02-25 01:13:45 +01:00
thefiddler
14d53010b0
[SDL2] Corrected win/alt key mapping (was swapped previously)
2014-02-25 01:13:45 +01:00
thefiddler
56e4b3cc85
[Mac] Implemented modifier keys
2014-02-25 01:13:45 +01:00
thefiddler
925abfdb10
[EGL] Removed unnecessary OpenTK.Platform.Windows reference
2014-02-21 14:04:33 +01:00
Stefanos A.
0052ff435e
[Win] Do not raise KeyPress for control chars
...
This matches the documented behavior of the GameWindow.KeyPress event.
2014-02-13 14:01:35 +01:00
Stefanos A.
d0522f1073
[Win] Do not create second WinMMJoystick instance
2014-02-01 16:03:07 +01:00
Stefanos A.
45df508f8f
[Win] Query WinMM joysticks on devicechange event
2014-02-01 16:02:02 +01:00
Stefanos A.
2d110728aa
[Win] Cache WinMM joystick capabilities
2014-02-01 16:01:33 +01:00
thefiddler
5145ebceb7
[Mac] Implemented JoystickHat support
2014-01-31 16:17:04 +01:00
thefiddler
a7228274aa
[Input] Added JoystickCapabilities.HatCount
2014-01-31 15:40:07 +01:00
thefiddler
168c45f0e2
[SDL2] Implemented support for hat state
2014-01-31 15:03:51 +01:00
thefiddler
71d6da80de
[Win] Faster WinMM GetCapabilities() and GetState()
...
joyGetDevCaps() is an extremely slow call that allocates memory.
WinMMJoystick is now caching its results for a significant speedup in
Joystick.GetCapabilities() and GetState().
The cache is updated whenever a joystick device is removed. WIP to
handle device added notifications.
2014-01-30 10:18:11 +01:00
thefiddler
eeaa3276f1
[Input] Implemented axis-button mappings
2014-01-29 10:39:18 +01:00
thefiddler
c73e4785cd
Merge remote-tracking branch 'cwassall/develop' into develop
2014-01-26 12:19:51 +01:00
Stefanos A.
06a3d7e1a7
[OpenTK] Don't skip AA modes in RelaxGraphicsMode
...
Previously, specifying an odd AA mode (e.g. 5x) would have been relaxed
to 0x. Now, it will be correctly relaxed to 4x.
2014-01-22 23:25:11 +01:00
thefiddler
417a6bedc1
[SDL2] Use RelaxGraphicsMode to find optimal mode
...
For SDL2, RelaxGraphicsMode requires us to clear context attributes
between consecutive attempts. This is implemented by calling
ClearGLAttributes().
2014-01-22 11:37:37 +01:00
thefiddler
0575e63a27
[Max] Use RelaxGraphicsMode to find optimal mode
2014-01-22 11:03:40 +01:00
thefiddler
6ba475e23f
[Win] Use RelaxGraphicsMode to find optimal mode
2014-01-22 10:49:55 +01:00
thefiddler
615df9201b
[OpenTK] Moved RelaxGraphicsMode to Utilities
...
This functionality is useful for all platform backends and is not
specific to the X11 backend.
2014-01-22 10:49:27 +01:00
Stefanos A.
770b697583
[Win] Clear extension list on reload
2014-01-21 09:04:27 +01:00
Stefanos A.
88ae446781
[Win] Removed WGL delegates in favor of calli
2014-01-21 09:00:57 +01:00
Stefanos A.
5379deaf63
[Win] Implemented calli-based interop for WGL
2014-01-21 09:00:25 +01:00
cwassall
7b591962e8
Change original_resolution field to a property
...
As the original_resolution field needs to be accessed from outside the
module, it should be an internal property as opposed to an internal
field
2014-01-20 12:51:55 +00:00
cwassall
5f6c8e654c
Remember DisplayDevice original resolutions
...
When refreshing the AvailableDevices list, it is important to set the
original resolution on any DisplayDevices that were previously available
to allow the RestoreResolution() method to work correctly.
2014-01-19 19:44:12 +00:00
Stefanos A.
b87b9e0a27
[Win] Fix X1/X2 mouse buttons (fixes issue #27 )
2014-01-16 17:16:03 +01:00
thefiddler
e6a9adf494
[OpenTK] Fixed polling
2014-01-15 01:19:45 +01:00
thefiddler
e7f037b0a2
[OpenTK] Fixed legacy joystick hotplugging & events
2014-01-15 01:13:39 +01:00
thefiddler
df7d7ae8eb
[Linux] Implemented joystick guid detection
2014-01-15 00:57:28 +01:00
thefiddler
fb917a6d89
[Linux] Implemented joystick hotplugging
2014-01-14 23:51:31 +01:00
Stefanos A.
4473c8373e
[X11] Implemented joystick hotplugging
...
This is a work in progress.
2014-01-14 18:37:16 +01:00
Stefanos A.
4203c14b22
[X11] Removed IJoystickDriver from X11Joystick
...
Legacy IJoystickDriver support is now implemented through a
LegacyJoystickDriver instance.
2014-01-14 18:36:19 +01:00
Stefanos A
f3036e5f10
Merge branch 'develop' into linux_joystick
2014-01-14 18:26:05 +01:00
Stefanos A
cb4e4d5e72
Merge branch 'legacy_joystick' into linux_joystick
2014-01-14 18:17:05 +01:00
Stefanos A.
d467629ad8
[Linux] Added INotify bindings
...
These are not currently used.
2014-01-14 18:15:53 +01:00
Stefanos A.
19eb72b3a9
[OpenTK] Fixed Utilities.CreateSdl2WindowInfo
...
Utilities.CreateSdl2WindowInfo should store the specified windowHandle
directly instead of trying to call SDL.SDL.CreateWindowFrom.
2014-01-10 16:56:26 +01:00
Stefanos A.
aff9719872
[SDL2] Implemented GetWindowWMInfo
2014-01-10 16:55:20 +01:00
Stefanos A.
bdfcf43e0b
[Win] More robust pixel format selection
...
This patch adds more robust checks for WGL_ARB_pixel_format and
WGL_ARB_multisample before using the relevant extensions, and adds
checks whether Wgl.Arb.ChoosePixelFormat() returns a valid pixel format
before trying to use it (thanks to Repetier for catching this edge
case.)
Additionally, the ChoosePixelFormatPFD code-path now heavily penalizes
single-buffered modes when the user requests a double-buffered mode.
Affects issues #42 and #45
2014-01-10 15:41:57 +01:00
Stefanos A.
ef5aedba6f
[Win] More robust WGL extension detection
...
Affects issue #42 and issue #45
2014-01-10 09:24:59 +01:00
thefiddler
a4d2a31386
[Mac] OpenGL 3.x/4.x require core profile flag
...
SDL will fail to construct an OpenGL 3.x/4.x context on Mac OS X,
unless ContextProfileFlags.CORE is specified.
Fixes issue #44
Upstream enhancement request at
https://bugzilla.libsdl.org/show_bug.cgi?id=2342
2014-01-09 23:36:28 +01:00
Stefanos A.
28ac3cec0b
[Win] Fix issue #35 (OpenTK over Remote Desktop)
...
When running over remote desktop without hardware acceleration, there
are no GraphicsModes that support desktop composition. This patch adds
logic to avoid requesting composition-capable modes when running over
RDP.
Additionally, it changes the mode selection logic to consider modes that
support features partially (e.g. 16bpp color instead of 32bpp), albeit
with a heavy penalty over fully supported modes.
2014-01-09 00:14:25 +01:00
Stefanos A.
1b3b510376
[Win] Check registry keys before accessing
...
Fixes crashes when using OpenTK over the Remote Desktop Client for Mac
(version 2010).
2014-01-09 00:10:41 +01:00
Stefanos A.
4af9d30ccb
[Win] Fix issue #33 ; fix issue #34
...
This patch adds a workaround for WM_STYLECHANGED messages that are not
delivered when running on Mono/Windows. If we detect Mono, then we call
HandleStyleChanged() directly in order to update the internal state of
our WinGLNative instance.
2014-01-08 22:29:22 +01:00
Stefanos A.
51ad513dbb
[Win] Do not overload internal SetWindowLong
...
The internal function is now appended with "Internal".
2014-01-08 19:22:03 +01:00
Stefanos A.
7363cfee7b
[Win] Do not unregister class twice
...
Only the parent window would register a class, but both the parent and
the child window would unregister it. This is now fixed.
2014-01-08 19:21:29 +01:00
Stefanos A.
51baed7286
[Win] Remove unnecessary #if clauses
2014-01-08 00:45:42 +01:00
Stefanos A.
e260a42954
[Win] Refactor huge wndproc into functions
2014-01-08 00:02:27 +01:00
thefiddler
94c3c24bfb
[OpenTK] Platform backends should inherit from PlatformFactoryBase
...
This reduces code duplication wrt deprecated interfaces and common
support code between backends.
2014-01-06 14:49:05 +01:00
thefiddler
d84be0d594
[OpenTK] Added base IPlatformFactory implementation
...
PlatformFactoryBase provides a common base interface for platform
backends. Platform backends should inherit from PlatformFactoryBase in
order to reduce code duplication.
2014-01-06 14:47:58 +01:00
thefiddler
a94a293732
[Platform] Implemented legacy IJoystickDriver
...
LegacyJoystickDriver implements the legacy IJoystickDriver interface
(GameWindow.Joysticks) in terms of the new IJoystickDriver2 interface
(OpenTK.Input.Joystick).
This removes a large chunk of code from each platform backend, as they
no longer need to implement IJoystickDriver themselves. Additionally,
it adds support for device hot plugging which was previously missing.
2014-01-06 14:25:05 +01:00
thefiddler
a9ab3650da
[Mac] Do not store *State structs directly
...
Storing Mouse/KeyboardState structs directly makes updates more
difficult than they should be. It is simpler to create simple classes
instead.
2014-01-05 23:58:05 +01:00
thefiddler
fda2d32d2d
[Mac] Map GamePads, MultiAxisControllers and Wheels to joysticks
2014-01-05 22:44:58 +01:00
thefiddler
a1123834a0
[Mac] Call DeviceRemoved() in Dispose() event
...
The necessary cleanup code already exists in DeviceRemoved(). No need
to duplicate this in the Dispose() event.
2014-01-05 22:38:26 +01:00
thefiddler
ab85afd5ba
[Mac] Avoid IOHIDDeviceConformsTo call in DeviceRemoved handler
...
DeviceAdded already checks that devices conform to the desired usage
pages. Checking again in DeviceRemoved is unnecessary - if a device
exists, then it has already passed muster.
2014-01-05 22:36:01 +01:00
thefiddler
9e223486f6
[Mac] Implement Joystick.GetGuid()
2014-01-05 22:15:55 +01:00
thefiddler
5c5afb3ea3
[Mac] Calculate joystick Guid for USB devices
2014-01-05 22:06:19 +01:00
thefiddler
b458b40683
[Mac] Use out/ref parameters instead of unsafe pointers in bindings
2014-01-05 22:05:54 +01:00
thefiddler
fa386dc991
[Mac] Connect devices to first available index
2014-01-05 21:53:28 +01:00
thefiddler
05af21e61b
[Mac] Do not call CFRelease on HID properties
...
HID properties are callee-owned and should not be released by the
caller. Fixes crash (memory corruption) on device hot plugging.
2014-01-05 21:27:34 +01:00
thefiddler
02c9f471ea
[Mac] DllImport must be marked as extern
2014-01-05 21:18:20 +01:00
thefiddler
7388bd935d
[Mac] Correctly unschedule HIDManager from run loop
2014-01-05 20:17:03 +01:00
thefiddler
4c7f6a92a7
[Mac] Don't let exceptions escape to unmanaged code
2014-01-05 04:20:51 +01:00
thefiddler
892d129e54
[Mac] Fixed DllEntryPointNotFound crash on device unplugging
2014-01-05 04:15:30 +01:00
thefiddler
2ee24efb2f
[Mac] Implemented joystick buttons
2014-01-05 04:11:11 +01:00
thefiddler
fad42994e1
[Mac] Implemented joystick axis movement
2014-01-05 03:54:53 +01:00
thefiddler
59249c2624
[Mac] Implemented joystick device detection
2014-01-05 03:03:46 +01:00
thefiddler
07bcda0f57
[Mac] Retrieve HID joystick name
2014-01-05 02:42:47 +01:00
thefiddler
6dadbd3570
[Mac] Implemented necessary CFString methods
2014-01-05 02:42:33 +01:00
thefiddler
32653d2c64
[Mac] Construct JoystickDevice when joysticks are connected
2014-01-05 00:47:40 +01:00
thefiddler
bf8efea121
[Mac] Only add callbacks for recognized USB HID devices
2014-01-05 00:00:49 +01:00
thefiddler
c44b477388
[Mac] Implement device added/removed events for joysticks
2014-01-04 23:58:59 +01:00
thefiddler
9659a1d786
[Mac] Add skeleton HID input implementation for joysticks
2014-01-04 23:55:38 +01:00
thefiddler
3a63496b6d
Merge branch 'gamepad' into develop
...
Conflicts:
Source/OpenTK/OpenTK.csproj
2014-01-03 02:23:02 +01:00
thefiddler
53552b0070
[Input] Corrected malformed documentation comments
2014-01-03 02:17:42 +01:00
thefiddler
8649e4a044
[Input] Added SetVibration() API skeleton
2014-01-02 19:52:00 +01:00
thefiddler
b513e35ea8
[SDL2] Implemented PacketNumber property
2014-01-02 19:24:38 +01:00
thefiddler
1ccf7e5ad2
[Input] Added PacketNumber property
2014-01-02 19:24:15 +01:00
thefiddler
b5d42b7992
[Input] Implemented GetState() and simplified GetCapabilities()
2014-01-02 18:37:53 +01:00
thefiddler
bf5d2a738d
[Input] Made configuration database non-static
2014-01-02 02:42:51 +01:00
thefiddler
9e4827bf67
[SDL2] Fixed SDL_JoystickGetGUID capitalization
2014-01-02 02:20:51 +01:00
thefiddler
fb57a9062d
[Input] Renamed GamePadMap to GamePadConfiguration
2014-01-02 01:38:12 +01:00
thefiddler
dc1ffab78d
[Input] Implemented IGamePadDriver.GetName()
2014-01-02 01:34:21 +01:00
thefiddler
a0dad7f698
[Input] Implemented MappedGamePadDriver.GetCapabilities()
2014-01-02 01:13:20 +01:00
thefiddler
b9a8e365de
[Input] Added IJoystickDriver2.GetGuid() API
2013-12-31 14:09:17 +01:00
thefiddler
cd143af60a
[SDL2] Added JoystickGetGUID method
2013-12-31 14:08:28 +01:00
thefiddler
1687518ef5
[SDL2] Add compile-time check for SDL2 GameController vs MappedGamePadDriver
2013-12-31 11:46:40 +01:00
thefiddler
d4348c5083
[SDL2] Fixed joystick/controller hotplugging support
2013-12-30 17:22:45 +01:00
thefiddler
9c8a5f5028
[SDL2] Fixed GameControllerButton to Buttons translation
2013-12-30 17:15:49 +01:00
thefiddler
43ef78f222
[SDL2] Fix issue where changes to mutable struct were lost
2013-12-30 17:09:20 +01:00
thefiddler
9beb396c9e
[SDL2] Explicitly enable joystick and gamepad events
2013-12-30 17:08:42 +01:00
Stefanos A.
6faa58aac3
[SDL2] Fixed joystick hotplugging
...
SDL2 uses a weird system of device ids and instance ids to report
joystick events, where the ADDED event uses a device id and the rest use
instance ids.
The SDL2 joystick driver is now fixed to correctly distinguish between
the two, which fixes hotplugging support for joystick devices.
2013-12-30 15:24:48 +01:00
thefiddler
52b8762593
[SDL2] Fixed mapping of instance ids to device ids
2013-12-30 14:57:28 +01:00
thefiddler
1b0a72472e
[SDL] Use TranslateAxis() to decode ControllerAxisEvent
...
SDL GameControllerAxis and GamePadAxes are not interchangeable. The
driver will now correctly interpret incoming SDL messages and update
the GamePadState for the relevant axis.
2013-12-30 13:42:37 +01:00
thefiddler
0b8db7c40b
[X11] Removed unused variable
2013-12-30 10:25:17 +01:00
thefiddler
4005710b99
[X11] Fixed current resolution detection.
2013-12-30 09:23:33 +01:00
thefiddler
5cebaccfca
[Dummy] Improved thread-safety; added entry-point loader
...
DummyGLContext will now attempt to load OpenGL and OpenGL ES entry
points when a suitable OpenGL context is current on the calling thread.
This allows OpenTK to be used on contexts created through third-party
toolkits.
2013-12-28 01:09:59 +01:00
thefiddler
8bcbb06f8e
[Platform] Added internal CreateGetAddress() function
...
CreateGetAddress() constructs a GraphicsContext.GetAddressDelegate that
is suitable for the current platform. This can be used when combining
OpenTK with an OpenGL context created through a third-party toolkit.
2013-12-28 01:08:24 +01:00
thefiddler
cf76aa6085
[Mac] Moved GetAddress implementation to its own class
...
The functions defined in libdl.dylib are useful in more places than
just AglContext. Moving them to their own class ensures we can access
these from wherever we might need them.
2013-12-28 01:06:33 +01:00
thefiddler
9171977079
[SDL2] Added missing [SuppressUnamangedCodeSecurity] attribute
2013-12-28 01:04:46 +01:00