Commit graph

209 commits

Author SHA1 Message Date
thefiddler
c1c6b4269b Merge pull request #149 from thefiddler/mac_stability
[Mac] Improved stability for NSOpenGLPixelFormat
2014-07-15 06:06:41 +00:00
thefiddler
32958ffcce [Mac] Improved stability for NSOpenGLPixelFormat
Non-accelerated contexts are now considered iff no accelerated contexts
are available. Additionally, a GraphicsException will be thrown if
context construction fails for any reason, instead of causing a runtime
crash.
2014-07-14 12:27:28 +02:00
thefiddler
8373782fad [Mac] Fix Mouse.GetState() h-wheel
External mice will now report horizontal scrolling in the low-level
`Mouse.GetState()` API. The touchpad apparently creates an emulated
mouse device that does not report horizontal wheel scrolling events.

Touchpad support probably requires a proper multitouch implementation.
2014-06-10 17:43:31 +02:00
thefiddler
5e63c5fa5c [Mac] Add note for higher precision pixel scroll 2014-06-10 16:41:09 +02:00
thefiddler
2a4f634848 [Mac] Match win32 scrolling coordinates 2014-06-10 16:40:44 +02:00
thefiddler
5b529647c9 [Mac] Fixed NRE and initial position on 64bit 2014-05-20 01:00:54 +02:00
thefiddler
c65e2a4d9e [Mac] Added NSFloat implementation 2014-05-20 00:14:57 +02:00
thefiddler
1419c1e3a0 [Mac] Explicitly retain/release CocoaWindowInfo instances 2014-05-14 18:01:08 +02:00
thefiddler
96aaef9b37 [Mac] Implemented Mouse.GetCursorState() 2014-05-12 02:20:53 +02:00
thefiddler
f4a3cab0e0 [Input] Added Mouse.GetCursorPos() (WIP) 2014-05-12 02:20:52 +02:00
thefiddler
d7e0373852 [Platform] Fixed keys getting stuck on focus loss
NativeWindowBase will now clear all keyboard keys when losing focus.
This prevents keys from getting stuck when refocusing the window.

[Win] Also fixed WindowState.Maximized when WindowBorder is Hidden and
the window is minimized.
2014-05-09 16:45:45 +02:00
thefiddler
b1f627893b [Mac] Fixed PointTo* calculations
On HiDPI displays, the client rectangle is using a pixel-based
coordinate system, while the screen is using a point-based coordinate
system. PointToClient/PointToScreen now correctly accounts for that.
2014-05-06 09:03:13 +02:00
thefiddler
41276361fb [Mac] Report KeyDown/Up events for modifier flags 2014-05-05 09:14:14 +02:00
thefiddler
8b7d5bc7e4 [Input] Implement key repeat 2014-05-05 00:43:45 +02:00
thefiddler
d968281a1b [OpenTK] Refactor keyboard and mouse handling
A lot of duplicated code is now moved to NativeWindowBase and
LegacyInputDriver.
2014-05-04 17:05:08 +02:00
thefiddler
28a1849a72 [Mac] Moved MacOSKeys to MacOS namespace
They are used by both Carbon and Cocoa, so there is little reason to
keep them in MacOS.Carbon
2014-05-04 17:02:37 +02:00
thefiddler
4b115c443b [Mac] Add horizontal scrolling 2014-05-04 15:24:02 +02:00
thefiddler
9dab96c5c1 [Mac] Disable momentum scrolling and key pop-ups
We might wish to add an option to re-enable momentum scrolling, as this
might be useful to some applications for a more native feel.
2014-05-04 15:23:24 +02:00
thefiddler
e093fd23f6 [Mac] Avoid calling into LegacyInputDriver 2014-05-04 08:32:26 +02:00
thefiddler
94fdf1881c [Platform] Improved mouse interface
- The complete mouse state is now available in mouse events
- Horizontal wheels are now supported
- MouseState now takes up less memory and has a simpler internal
implementation.
2014-05-04 01:29:55 +02:00
thefiddler
3e33ac9280 [Platform] Refactored INativeWindow backends
All INativeWindow implementations are now derived from
NativeWindowBase. They no longer implement legacy IInputDriver
themselves, but rather rely on LegacyInputDriver provided by
NativeWindowBase for compatibility. They also implement the new Mouse*
events.
2014-05-02 16:52:11 +02:00
thefiddler
674cd54c29 [Mac] Fixed initial window position
Cocoa sets the desktop origin at the bottom-left of the main screen,
with +y going up. OpenTK is setting the origin at the top-left of the
main screen, so we need to invert the y-axis.
2014-05-02 15:13:38 +02:00
thefiddler
3824f55f18 [Mac] Fixed cursor coords when CursorVisible=false 2014-05-02 14:21:32 +02:00
thefiddler
612652910f [Platform] Inherit NativeWindowBase 2014-05-02 14:18:40 +02:00
thefiddler
300203f73b [Mac] Use On* methods from base class 2014-05-02 09:41:27 +02:00
thefiddler
f2eca2924f [Mac] Inherit from NativeWindowBase
This reduces code duplication significantly.
2014-05-02 09:37:25 +02:00
thefiddler
c8c0d32fcc [OpenTK] Rearranged MouseCursor parameters
MouseCursor and WindowIcon now match GL.TexImage2D in the way they
arrange their parameters. The expected values of each parameter are now
documented.
2014-04-30 20:04:31 +02:00
thefiddler
e63970e2be [Mac] Fixed cursor byte order 2014-04-30 09:06:18 +02:00
thefiddler
7d8f14baa7 [Mac] Implement NSCursor rectangles 2014-04-30 08:38:19 +02:00
thefiddler
3da459b316 [All] Fixed checks for EXT_swap_control_tear
EGL and NSOpenGL do not offer an EXT_swap_control_tear equivalent so
use regular vsync for now. The relevant extension string is now
correctly checked on WGL and GLX.
2014-04-29 08:10:18 +02:00
thefiddler
ab6b3c211c [Mac] Removed unused CarbonGLNative.cs 2014-04-28 17:17:34 +02:00
thefiddler
88a60b14c5 [Mac] Remove call to NewEventHandlerUPP
NewEventHandlerUPP fails to load when running through MonoKickstart. It
appears that this function is only used for old PPC systems that had
trouble with function pointers - sample code online indicates that we
do not need to call this.
2014-04-28 16:25:23 +02:00
thefiddler
cf3a30d024 [Mac] CGDisplayBounds signature now matches Mac ABI
This resolves a crash in CGDisplayBounds when running through monokick.
2014-04-28 16:25:10 +02:00
thefiddler
ffb7bd8a4c Merge branch 'pr/105' into develop 2014-04-28 16:19:17 +02:00
thefiddler
53d2c8d1e8 [Mac] Cmd-Q should raise Closing events
It should also be cancelable.
2014-04-28 16:19:04 +02:00
thefiddler
48e21328c5 [Mac] Implement INativeWindow.Cursor 2014-04-27 19:45:20 +02:00
thefiddler
a61d20d2eb [Mac] Stubbed INativeWindow.Cursor 2014-04-27 10:56:08 +02:00
thefiddler
dd55cea489 [All] Initial implementation of INativeWindow.Cursor property
Affects issue #9
2014-04-27 10:52:53 +02:00
Olle Håkansson
160e6ecb31 Added Quit menu item + shortcut (Cmd+Q). 2014-04-27 10:52:28 +02:00
Olle Håkansson
a24ce9ba11 Fixed creating contexts without native windows.
To create a context for the GTK GLWidget, you need to be able to
specify the exact NSView you want the OpenGL context to apply to. Also,
you don’t want to initialise the NSApplication in this situation, which
the CocoaContext did before (unintentionally).
2014-04-27 09:58:05 +02:00
thefiddler
b732e377c9 [Mac] Sped up extension loading
From ~200ms down to ~65ms on a rMBP with Nvidia 650M and Mac OS X
10.9.2.
2014-04-26 14:21:26 +02:00
thefiddler
e36a0d0fbc [OpenTK] Rebased on develop 2014-04-25 13:38:53 +02:00
thefiddler
9f39aa1b88 [Mac] Optimized MacOSKeyCode translation
This also reduces memory allocations on startup by ~10K.
2014-04-25 12:14:26 +02:00
thefiddler
824f238973 [Mac] Removed most legacy Carbon code 2014-04-24 13:48:26 +02:00
thefiddler
5f44f3d491 [Mac] Removed unused Carbon APIs 2014-04-24 13:48:26 +02:00
thefiddler
cdd88e6f7e [Mac] Migrated AglContext to OpenTK.GLControl 2014-04-24 13:48:26 +02:00
thefiddler
3475582c30 [Mac] Mouse coordinates are reported in pixels 2014-04-24 13:47:30 +02:00
thefiddler
e0848f9d6d [Mac] SendFloat should use _fpret on i386 2014-04-24 13:47:30 +02:00
thefiddler
3250cbbc91 [Mac] Use scrollFactor variable 2014-04-24 13:47:30 +02:00
thefiddler
a2212f0184 [Mac] Fixed a warning related to volatile UniqueId
Also changed the class name to OpenTK_GameWindow
2014-04-24 13:47:30 +02:00