Commit graph

3510 commits

Author SHA1 Message Date
thefiddler
ff46455e56 [X11] Removed legacy X11Input driver
Its functionality has been moved directly into X11GLNative and
X11KeyMap.
2014-05-04 08:32:08 +02:00
thefiddler
39eb3b1892 [Input] Improved MouseState.ToString() 2014-05-04 08:31:11 +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
e85377c350 [Platform] Added support for horizontal wheel 2014-05-03 16:47:03 +02:00
thefiddler
842c0499b9 [SDL] Corrected SDL_Mouse* event structs 2014-05-02 17:39:00 +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
89fc36bde1 [Platform] Added INativeWindow.Mouse* events 2014-05-02 14:18:52 +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
10939fcaec [OpenTK] Add On* methods to raise events 2014-05-02 09:37:25 +02:00
thefiddler
24b19d2487 [Input] Added internal MouseDevice.Position getter 2014-05-02 09:37:25 +02:00
thefiddler
f2eca2924f [Mac] Inherit from NativeWindowBase
This reduces code duplication significantly.
2014-05-02 09:37:25 +02:00
thefiddler
5ba1bf89f1 [OpenTK] Added NativeWindowBase
This acts as a common base class to INativeWindow implementations and
can be used to reduce code duplication.
2014-05-02 09:34:14 +02:00
thefiddler
9ee728d4fc [Win] Only set MouseCursor in client area
This is required according to the windows documentation.
2014-05-01 16:49:23 +02:00
thefiddler
9988a2ba9c [SDL][Win] Destroy custom cursor on Close()
X11 destroys the cursor after setting it and Cocoa uses an autorelease
pool, so that should not be necessary there.
2014-05-01 14:27:20 +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
8568e6dc70 [SDL] Fixed MouseCursor getting stuck after multiple changes 2014-04-30 13:46:44 +02:00
thefiddler
a5ddc530c2 [SDL] Fixed custom MouseCursor 2014-04-30 13:36:16 +02:00
thefiddler
e63970e2be [Mac] Fixed cursor byte order 2014-04-30 09:06:18 +02:00
thefiddler
2632661d8a [OpenTK] Fixed compilation error 2014-04-30 08:45:27 +02:00
thefiddler
965c8baa7f [OpenTK] Renamed x/y to hotx/hoty
The new name matches their functionality closer.
2014-04-30 08:44:48 +02:00
thefiddler
890805f2ae [Platform] Renamed MouseCursor.Rgba to Argb
This matches the default format of System.Drawing.Bitmap.
2014-04-30 08:38:57 +02:00
thefiddler
7d8f14baa7 [Mac] Implement NSCursor rectangles 2014-04-30 08:38:19 +02:00
thefiddler
d013ef1868 [Platform] Make MouseCursor actor public 2014-04-30 08:37:34 +02:00
thefiddler
0ed1e8b6d8 [Win] Log wglSwapIntervalEXT errors
Note that we cannot use Marshal.GetLastWin32Error because we are not
using regular DllImports for WGL extensions.
2014-04-29 08:48:49 +02:00
thefiddler
f2dc40abdd [OpenTK] Query the driver for VSyncMode getter
Otherwise, the user could call Context.SwapInterval directly, causing
the vsync property to fall out of sync.
2014-04-29 08:31:47 +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
509f356ed4 [Win] Fixed MouseCursor.Default
It is now possible to switch from a custom cursor back to
MouseCursor.Default.
2014-04-28 09:37:16 +02:00
thefiddler
4f9a2f78d6 Merge branch 'cursor' of https://github.com/thefiddler/opentk into thefiddler-cursor 2014-04-28 07:07:47 +02:00
thefiddler
0f920fb205 [X11] Fixed SGI_swap_control query
GLX can return valid function pointer to unsupported functions.
We need to check for extension support in addition to the
function pointer.

Fixes crash on OpenSUSE 13.1 in VirtualBox.
2014-04-28 01:29:34 +02:00
thefiddler
168713aecf [GL] Added GetPName.Max*ImageUniforms
These tokens were introduced in OpenGL 4.2 and 4.3.
2014-04-27 22:47:04 +02:00
thefiddler
c40115e223 [OpenTK] Only init X11 if SDL2 is not used 2014-04-27 22:41:24 +02:00
thefiddler
96b7419d83 [X11] Fixed INativeWindow.Cursor getter 2014-04-27 22:28:10 +02:00
thefiddler
d03e9d82dc [Input] Fixed key modifiers in KeyboardDevice events 2014-04-27 22:27:18 +02:00
thefiddler
d787656328 [SDL] Fixed cursor support
SDL.CreateColorCursor takes 3 arguments, not 5.
2014-04-27 21:09:51 +02:00
thefiddler
48e21328c5 [Mac] Implement INativeWindow.Cursor 2014-04-27 19:45:20 +02:00
thefiddler
283a785703 [OpenTK] Treat null as MouseCursor.Empty 2014-04-27 19:45:08 +02:00
thefiddler
1d8ef7165f [OpenTK] Disable custom MouseCursors
They require further development, due to byte-order differences between
platforms.

MouseCursor is now derived from WindowIcon, which we will use for
INativeWindow.Icon support in the future, in order to remove the
dependency to System.Drawing.
2014-04-27 19:44:45 +02:00
thefiddler
a61d20d2eb [Mac] Stubbed INativeWindow.Cursor 2014-04-27 10:56:08 +02:00
Fraser Waters
2207144aec Fix a bug in X11 CursorVisble with custom cursors.
CursorVisible reset to the default cursor when showing the cursor, it
should instead show the custom cursor if it's defined (else the default
cursor).
2014-04-27 10:53:34 +02:00
Fraser Waters
9ed32e4445 Change bool to IntPtr.
WindowProc returns an IntPtr not a bool, so let Handle* functions return
IntPtr?. If they return a value we return that, if they return null we
call DefWindowProc and return the result from that.
2014-04-27 10:53:34 +02:00
Fraser Waters
9239fd08e3 Custom cursors on X11. 2014-04-27 10:53:33 +02:00
Fraser Waters
6e23a55f35 Add XcursorImageLoadCursor function. 2014-04-27 10:53:33 +02:00