thefiddler [Tue, 13 May 2014 20:31:45 +0000 (22:31 +0200)]
[X11] Improved CursorVisible = false behavior
We now use an XGrabPointer to confine the cursor to the window,
instead of the XWarpPointer hack. Fixes issue #28 and #36.
thefiddler [Tue, 13 May 2014 11:23:20 +0000 (13:23 +0200)]
[X11] Fixed cursor position when CursorVisible becomes true
thefiddler [Tue, 13 May 2014 07:27:21 +0000 (09:27 +0200)]
[X11] Fixed Cursor when CursorVisible = false
Setting Cursor will no longer override CursorVisible.
thefiddler [Mon, 12 May 2014 15:01:01 +0000 (17:01 +0200)]
Merge branch 'nulldisplay' into develop
thefiddler [Mon, 12 May 2014 15:00:42 +0000 (17:00 +0200)]
Merge branch 'nvidiafix' into develop
thefiddler [Mon, 12 May 2014 15:00:16 +0000 (17:00 +0200)]
Merge branch 'arrayfix' into develop
thefiddler [Mon, 12 May 2014 14:34:02 +0000 (16:34 +0200)]
[Rewrite] Removed unused conditional.
thefiddler [Thu, 1 May 2014 07:47:55 +0000 (09:47 +0200)]
[OpenTK] Do not crash when no monitor connected
NativeWindow now checks for a non-null device before attempting to
access its properties. Affects
https://github.com/mono/MonoGame/issues/2416
thefiddler [Mon, 12 May 2014 12:50:03 +0000 (14:50 +0200)]
[X11] Correct Glx.*.SwapInterval definitions
Improved error checking means we are no longer crashing when
SwapInterval is not available.
thefiddler [Mon, 12 May 2014 11:59:48 +0000 (13:59 +0200)]
[X11] Fixed GLX extension loading
GLX is now using the new extension loading mechanism,
and the entry point names now much the available slots.
thefiddler [Mon, 12 May 2014 11:03:27 +0000 (13:03 +0200)]
[Rewrite] Fixed 2d/3d arrays on .Net
Mono can use ldlen and ldelema on both 1d arrays (vectors) and 2d/3d
arrays. However, .Net can only use these instructions on 1d arrays -
higher rank arrays must use get_Length and Address explicitly.
thefiddler [Sun, 11 May 2014 23:49:38 +0000 (01:49 +0200)]
[X11] Flush XSendEvent on exit
thefiddler [Sun, 11 May 2014 23:48:06 +0000 (01:48 +0200)]
[X11] Fixed XI2Mouse smooth scrolling
The scrolling valuator offsets are now calculated correctly, based on
the number of set bits in the valuator mask.
Additionally XI2Mouse now runs on a background thread, using blocking
XIfEvent. This should improve resonsiveness and reduce CPU usage, due
to reduced polling.
thefiddler [Sun, 11 May 2014 20:54:47 +0000 (22:54 +0200)]
[X11] Improved XI2Mouse implementation
Horizontal and vertical smooth scrolling is now supported.
Movement axes are now correctly identified. Device hotplugging
has been improved.
thefiddler [Sat, 10 May 2014 15:54:49 +0000 (17:54 +0200)]
[Examples] Improved Mouse.GetState output
thefiddler [Sat, 10 May 2014 15:54:34 +0000 (17:54 +0200)]
[Mac] Implemented Mouse.GetCursorState()
thefiddler [Sat, 10 May 2014 00:12:52 +0000 (02:12 +0200)]
[Examples] Test Mouse.SetPosition
thefiddler [Sat, 10 May 2014 00:06:40 +0000 (02:06 +0200)]
[SDL] Use h-wheel events
thefiddler [Fri, 9 May 2014 23:44:27 +0000 (01:44 +0200)]
[Input] Improve SDL2 and Windows GetCursorState
thefiddler [Fri, 9 May 2014 23:30:46 +0000 (01:30 +0200)]
[Input] Added Mouse.GetCursorPos() (WIP)
thefiddler [Mon, 12 May 2014 00:20:29 +0000 (02:20 +0200)]
Merge pull request #114 from thefiddler/nativewindow
INativeWindow cleanup and consolidation
thefiddler [Fri, 9 May 2014 23:52:06 +0000 (01:52 +0200)]
[Examples] Fixed Scroll.X/Y misreporting
Scroll.X and Y are no longer swapped.
thefiddler [Fri, 9 May 2014 14:45:45 +0000 (16:45 +0200)]
[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.
thefiddler [Fri, 9 May 2014 14:14:13 +0000 (16:14 +0200)]
[Win] Fixed infinite recursion
thefiddler [Fri, 9 May 2014 13:24:12 +0000 (15:24 +0200)]
[Graphics] Made entry points internal
Internal protected means internal *or* protected, not internal *and*
protected.
thefiddler [Fri, 9 May 2014 13:23:39 +0000 (15:23 +0200)]
[Input] Do not hook FocusedChanged
This is handled by NativeWindowBase now.
thefiddler [Fri, 9 May 2014 13:22:33 +0000 (15:22 +0200)]
[Win] Cleaned up window size/pos properties
thefiddler [Fri, 9 May 2014 11:10:23 +0000 (13:10 +0200)]
[X11] Fixed WindowBorder and WindowState setters
After many hours of fighting with xlib, the monster is slain and
WindowBorder/WindowState changes now take effect without messing
up the window size or position on the desktop.
Phew!
thefiddler [Thu, 8 May 2014 23:49:51 +0000 (01:49 +0200)]
[Platform] Raise KeyUp events on focus lost
This ensures that no keys are stuck in pressed state when the user
switches away from the application window.
thefiddler [Thu, 8 May 2014 22:26:51 +0000 (00:26 +0200)]
[X11] Fixed key repeat
thefiddler [Thu, 8 May 2014 22:13:23 +0000 (00:13 +0200)]
[X11] Improved vsync support
OpenTK will now check for GLX_EXT_swap_control, GLX_MESA_swap_control
and GLX_SGI_swap_control. This allows us to control vsync on more
systems.
thefiddler [Thu, 8 May 2014 18:58:11 +0000 (20:58 +0200)]
[X11] Corrected size events
thefiddler [Wed, 7 May 2014 22:51:32 +0000 (00:51 +0200)]
Merge pull request #113 from danzel/develop
[Platform] Correct spelling in INativeWindow
Dave Leaver [Wed, 7 May 2014 22:21:27 +0000 (10:21 +1200)]
Correct spelling in INativeWindow
thefiddler [Wed, 7 May 2014 21:21:24 +0000 (23:21 +0200)]
[GL] Added generic RenderbufferStorage depth-stencil formats
According to the OpenGL 4.4 specification, RenderbufferStorage accepts
both generic and sized depth-stencil formats (DepthComponent and
DepthStencil). See sections 9.2.4, 9.2.5 and 9.4.
thefiddler [Wed, 7 May 2014 11:24:22 +0000 (13:24 +0200)]
Merge pull request #111 from thefiddler/sdl_stack_fix
[SDL] Fixed a stack corruption issue on win32
thefiddler [Tue, 6 May 2014 07:36:30 +0000 (09:36 +0200)]
[SDL] Avoid CursorVisible = true cursor jump
thefiddler [Tue, 6 May 2014 07:31:35 +0000 (09:31 +0200)]
[SDL] Report mouse in client coordinates
thefiddler [Tue, 6 May 2014 07:12:08 +0000 (09:12 +0200)]
[Examples] Test MouseCursor in GameWindowStates
thefiddler [Tue, 6 May 2014 07:03:13 +0000 (09:03 +0200)]
[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.
thefiddler [Tue, 6 May 2014 07:02:09 +0000 (09:02 +0200)]
[Platform] Forward PointToScreen to backend
thefiddler [Tue, 6 May 2014 07:01:23 +0000 (09:01 +0200)]
[Platform] More selective mouse events
We should not raise mouse events when the cursor state hasn’t changed.
thefiddler [Tue, 6 May 2014 07:00:42 +0000 (09:00 +0200)]
[Examples] Added PointToClient test
thefiddler [Mon, 5 May 2014 13:11:01 +0000 (15:11 +0200)]
[SDL] Improved documentation of Event size hack
Stefanos A [Mon, 5 May 2014 10:46:48 +0000 (12:46 +0200)]
[SDL] Fixed a stack corruption issue on win32
thefiddler [Mon, 5 May 2014 07:14:14 +0000 (09:14 +0200)]
[Mac] Report KeyDown/Up events for modifier flags
thefiddler [Sun, 4 May 2014 22:56:19 +0000 (00:56 +0200)]
[Examples] Print KeyboardState
thefiddler [Sun, 4 May 2014 22:43:58 +0000 (00:43 +0200)]
[Examples] Test key events for consistency
thefiddler [Sun, 4 May 2014 22:43:45 +0000 (00:43 +0200)]
[Input] Implement key repeat
thefiddler [Sun, 4 May 2014 15:05:08 +0000 (17:05 +0200)]
[OpenTK] Refactor keyboard and mouse handling
A lot of duplicated code is now moved to NativeWindowBase and
LegacyInputDriver.
thefiddler [Sun, 4 May 2014 15:04:03 +0000 (17:04 +0200)]
[X11] Added X11KeyMap.TranslateButton()
This code was duplicated on four different places before.
thefiddler [Sun, 4 May 2014 15:02:37 +0000 (17:02 +0200)]
[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
thefiddler [Sun, 4 May 2014 15:02:00 +0000 (17:02 +0200)]
[Input] Update state through HandleKey* events
thefiddler [Sun, 4 May 2014 15:01:34 +0000 (17:01 +0200)]
[Input] Removed pointless unsafe region
thefiddler [Sun, 4 May 2014 14:58:59 +0000 (16:58 +0200)]
[Input] Removed pointless ValuePrecise setter
thefiddler [Sun, 4 May 2014 14:58:24 +0000 (16:58 +0200)]
[Input] Removed pointless MouseDevice.SetState
MouseDevice state should only be modified through its HandleMouse*
methods, not directly.
thefiddler [Sun, 4 May 2014 13:24:02 +0000 (15:24 +0200)]
[Mac] Add horizontal scrolling
thefiddler [Sun, 4 May 2014 13:23:40 +0000 (15:23 +0200)]
[OpenTK] Raise NativeWindow.Mouse* events
thefiddler [Sun, 4 May 2014 13:23:24 +0000 (15:23 +0200)]
[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.
thefiddler [Sun, 4 May 2014 06:34:13 +0000 (08:34 +0200)]
[Platform] Remove lambdas
thefiddler [Sun, 4 May 2014 06:33:51 +0000 (08:33 +0200)]
[Examples] Hook both MouseDevice and Mouse events
They should give identical results.
thefiddler [Sun, 4 May 2014 06:33:20 +0000 (08:33 +0200)]
[Input] MouseDevice is now based on MouseState
This way we have a single state representation (MouseState), shared by
all mouse APIs and events.
thefiddler [Sun, 4 May 2014 06:32:26 +0000 (08:32 +0200)]
[Mac] Avoid calling into LegacyInputDriver
thefiddler [Sun, 4 May 2014 06:32:08 +0000 (08:32 +0200)]
[X11] Removed legacy X11Input driver
Its functionality has been moved directly into X11GLNative and
X11KeyMap.
thefiddler [Sun, 4 May 2014 06:31:11 +0000 (08:31 +0200)]
[Input] Improved MouseState.ToString()
thefiddler [Sat, 3 May 2014 23:29:55 +0000 (01:29 +0200)]
[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.
thefiddler [Sat, 3 May 2014 14:47:03 +0000 (16:47 +0200)]
[Platform] Added support for horizontal wheel
thefiddler [Fri, 2 May 2014 15:39:00 +0000 (17:39 +0200)]
[SDL] Corrected SDL_Mouse* event structs
thefiddler [Fri, 2 May 2014 14:52:11 +0000 (16:52 +0200)]
[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.
thefiddler [Fri, 2 May 2014 13:13:38 +0000 (15:13 +0200)]
[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.
thefiddler [Fri, 2 May 2014 12:21:32 +0000 (14:21 +0200)]
[Mac] Fixed cursor coords when CursorVisible=false
thefiddler [Fri, 2 May 2014 12:18:52 +0000 (14:18 +0200)]
[Platform] Added INativeWindow.Mouse* events
thefiddler [Fri, 2 May 2014 12:18:40 +0000 (14:18 +0200)]
[Platform] Inherit NativeWindowBase
thefiddler [Sun, 27 Apr 2014 07:39:30 +0000 (09:39 +0200)]
[Mac] Use On* methods from base class
thefiddler [Sun, 27 Apr 2014 07:39:18 +0000 (09:39 +0200)]
[OpenTK] Add On* methods to raise events
thefiddler [Sun, 27 Apr 2014 07:38:55 +0000 (09:38 +0200)]
[Input] Added internal MouseDevice.Position getter
thefiddler [Sun, 27 Apr 2014 07:21:33 +0000 (09:21 +0200)]
[Mac] Inherit from NativeWindowBase
This reduces code duplication significantly.
thefiddler [Sun, 27 Apr 2014 07:20:33 +0000 (09:20 +0200)]
[OpenTK] Added NativeWindowBase
This acts as a common base class to INativeWindow implementations and
can be used to reduce code duplication.
thefiddler [Thu, 1 May 2014 21:56:25 +0000 (23:56 +0200)]
[Examples] Use Key.Enter to capture mouse
thefiddler [Thu, 1 May 2014 20:17:06 +0000 (22:17 +0200)]
[Examples] Fixed cursor hotspot
thefiddler [Thu, 1 May 2014 15:03:47 +0000 (17:03 +0200)]
[Examples] Improved MouseCursor example
thefiddler [Thu, 1 May 2014 14:49:23 +0000 (16:49 +0200)]
[Win] Only set MouseCursor in client area
This is required according to the windows documentation.
thefiddler [Thu, 1 May 2014 12:27:20 +0000 (14:27 +0200)]
[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.
thefiddler [Wed, 30 Apr 2014 18:04:31 +0000 (20:04 +0200)]
[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.
thefiddler [Wed, 30 Apr 2014 11:46:44 +0000 (13:46 +0200)]
[SDL] Fixed MouseCursor getting stuck after multiple changes
thefiddler [Wed, 30 Apr 2014 11:36:16 +0000 (13:36 +0200)]
[SDL] Fixed custom MouseCursor
thefiddler [Wed, 30 Apr 2014 07:06:30 +0000 (09:06 +0200)]
[Example] Test custom cursor
thefiddler [Wed, 30 Apr 2014 07:06:18 +0000 (09:06 +0200)]
[Mac] Fixed cursor byte order
thefiddler [Wed, 30 Apr 2014 06:45:27 +0000 (08:45 +0200)]
[OpenTK] Fixed compilation error
thefiddler [Wed, 30 Apr 2014 06:44:48 +0000 (08:44 +0200)]
[OpenTK] Renamed x/y to hotx/hoty
The new name matches their functionality closer.
thefiddler [Wed, 30 Apr 2014 06:38:57 +0000 (08:38 +0200)]
[Platform] Renamed MouseCursor.Rgba to Argb
This matches the default format of System.Drawing.Bitmap.
thefiddler [Wed, 30 Apr 2014 06:38:19 +0000 (08:38 +0200)]
[Mac] Implement NSCursor rectangles
thefiddler [Wed, 30 Apr 2014 06:37:34 +0000 (08:37 +0200)]
[Platform] Make MouseCursor actor public
thefiddler [Tue, 29 Apr 2014 06:48:49 +0000 (08:48 +0200)]
[Win] Log wglSwapIntervalEXT errors
Note that we cannot use Marshal.GetLastWin32Error because we are not
using regular DllImports for WGL extensions.
thefiddler [Tue, 29 Apr 2014 06:31:47 +0000 (08:31 +0200)]
[OpenTK] Query the driver for VSyncMode getter
Otherwise, the user could call Context.SwapInterval directly, causing
the vsync property to fall out of sync.
thefiddler [Tue, 29 Apr 2014 06:10:18 +0000 (08:10 +0200)]
[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.
thefiddler [Mon, 28 Apr 2014 15:17:34 +0000 (17:17 +0200)]
[Mac] Removed unused CarbonGLNative.cs
thefiddler [Fri, 4 Apr 2014 06:46:32 +0000 (08:46 +0200)]
[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.
thefiddler [Thu, 3 Apr 2014 21:19:31 +0000 (23:19 +0200)]
[Mac] CGDisplayBounds signature now matches Mac ABI
This resolves a crash in CGDisplayBounds when running through monokick.
thefiddler [Mon, 28 Apr 2014 14:19:17 +0000 (16:19 +0200)]
Merge branch 'pr/105' into develop