Commit graph

5715 commits

Author SHA1 Message Date
Stefanos A. a961fb3db3 [Examples] Added keys to modify timing
Use [ and ] to decrease and increase the UpdateFrame frequency.
Use < and > to decrease and increase the RenderFrame frequency.
2014-01-07 22:09:52 +01:00
Stefanos A. b6a806a568 [OpenTK] Improved timing stability
OpenTK now directly calculates the elapsed time between UpdateFrame
(RenderFrame) events and compares that directly to TargetUpdatePeriod
(TargetRenderPeriod). This significantly simplifies the implementation
and improves timing stability.
2014-01-07 22:09:02 +01:00
Stefanos A. 6e03d501ae [OpenTK] Fixed Update/RenderTime calculation
These values should only be re-calculated when an Update/RenderFrame
event is raised. Otherwise, they should retain their previous values.
2014-01-07 15:55:11 +01:00
thefiddler 251f5717ae [Examples] Improve timing information; add vsync toggle 2014-01-07 09:12:35 +01:00
thefiddler 99df27b635 [OpenTK] Corrected GameWindow.Update/RenderFrequency information 2014-01-07 09:11:55 +01:00
thefiddler 56a3dd91e5 [OpenTK] Implemented GameWindow.UpdateTime and RenderTime properties 2014-01-07 09:09:43 +01:00
thefiddler 3856fcd48e [OpenTK] More robust timing for UpdateFrame and RenderFrame
FrameEventArgs.Time should no longer drift from clock time measured
outside GameWindow.
2014-01-07 08:52:02 +01:00
thefiddler c5dcc8a93b [Examples] Calculate timing information in GameWindowStates 2014-01-07 01:01:00 +01:00
thefiddler d49dacb5b3 [Examples] Cleaned up input device printing in GameWindowStates 2014-01-07 00:48:09 +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
Stefanos A. 83f54f70aa [OpenTK] Simplify and improve timing calculations
This patch modifies GameWindow.Run() to use a single stopwatch instead
of two separate stopwatches for timing UpdateFrame and RenderFrame
events.

It improves timing accuracy for issue #20 (FrameEventArgs.Time
Inconsistencies)
2014-01-06 01:57:54 +01:00
Stefanos A. 88c57db5b6 [Math] Added MathHelper.Clamp 2014-01-06 01:52:08 +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 4d660fdeba [Input] Added Keyboard/MouseState.SetIsConnected to mirror JoystickState 2014-01-05 23:50:17 +01:00
thefiddler e984ddd783 Merge branch 'mac_joystick' into develop 2014-01-05 22:50:27 +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 fc81f30251 [Examples] Draw device index for Joysticks and GamePads 2014-01-05 21:32:24 +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 92635b3f35 [Input] Added JoystickAxis/Button.Last; added JoystickAxis.Axis10.
JoystickAxis/Button.Last is used internally to allocate the correct
amount of storage for joystick axes and buttons. JoystickAxis.Axis10 is
required to support the maximum number of axes available on Mac OS X.
2014-01-05 03:54:34 +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 3757db9978 [Input] Allow extending JoystickDevice<> 2014-01-05 00:46:59 +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 514390fc9a [Graphics] Added missing documentation comment 2014-01-03 02:18:28 +01:00
thefiddler 53552b0070 [Input] Corrected malformed documentation comments 2014-01-03 02:17:42 +01:00
thefiddler 3095afa18a [Input] Documented all public members 2014-01-03 01:58:16 +01:00
thefiddler b35aad1503 [Input] Removed JoystickState.GetAxis(int) overload 2014-01-03 01:58:08 +01:00
thefiddler 8649e4a044 [Input] Added SetVibration() API skeleton 2014-01-02 19:52:00 +01:00
thefiddler ec43b9ff85 [Input] GamePad and Joystick classes should be sealed 2014-01-02 19:27:04 +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