platform/core/csapi/opentk.git
10 years ago[X11] Warn when XI2Mouse is not supported.
thefiddler [Tue, 13 May 2014 21:34:27 +0000 (23:34 +0200)]
[X11] Warn when XI2Mouse is not supported.

Without the XI2 extension, mouse support will suffer significantly.
More specifically, low-level mouse events will not be available.

10 years ago[Input] Renamed MouseScrollWheel to MouseScroll
thefiddler [Tue, 13 May 2014 21:25:56 +0000 (23:25 +0200)]
[Input] Renamed MouseScrollWheel to MouseScroll

This better describes the functionality of this structure.

10 years ago[X11] Implemented high-resolution scroll events
thefiddler [Tue, 13 May 2014 21:23:51 +0000 (23:23 +0200)]
[X11] Implemented high-resolution scroll events

10 years ago[Platform] Fixed OnMouseDown/Up events for secondary buttons
thefiddler [Tue, 13 May 2014 20:53:47 +0000 (22:53 +0200)]
[Platform] Fixed OnMouseDown/Up events for secondary buttons

10 years ago[X11] Improved CursorVisible = false behavior
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.

10 years ago[X11] Fixed cursor position when CursorVisible becomes true
thefiddler [Tue, 13 May 2014 11:23:20 +0000 (13:23 +0200)]
[X11] Fixed cursor position when CursorVisible becomes true

10 years ago[X11] Fixed Cursor when CursorVisible = false
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.

10 years agoMerge branch 'nulldisplay' into develop
thefiddler [Mon, 12 May 2014 15:01:01 +0000 (17:01 +0200)]
Merge branch 'nulldisplay' into develop

10 years agoMerge branch 'nvidiafix' into develop
thefiddler [Mon, 12 May 2014 15:00:42 +0000 (17:00 +0200)]
Merge branch 'nvidiafix' into develop

10 years agoMerge branch 'arrayfix' into develop
thefiddler [Mon, 12 May 2014 15:00:16 +0000 (17:00 +0200)]
Merge branch 'arrayfix' into develop

10 years ago[Rewrite] Removed unused conditional.
thefiddler [Mon, 12 May 2014 14:34:02 +0000 (16:34 +0200)]
[Rewrite] Removed unused conditional.

10 years ago[OpenTK] Do not crash when no monitor connected
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

10 years ago[X11] Correct Glx.*.SwapInterval definitions
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.

10 years ago[X11] Fixed GLX extension loading
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.

10 years ago[Rewrite] Fixed 2d/3d arrays on .Net
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.

10 years ago[X11] Flush XSendEvent on exit
thefiddler [Sun, 11 May 2014 23:49:38 +0000 (01:49 +0200)]
[X11] Flush XSendEvent on exit

10 years ago[X11] Fixed XI2Mouse smooth scrolling
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.

10 years ago[X11] Improved XI2Mouse implementation
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.

10 years ago[Examples] Improved Mouse.GetState output
thefiddler [Sat, 10 May 2014 15:54:49 +0000 (17:54 +0200)]
[Examples] Improved Mouse.GetState output

10 years ago[Mac] Implemented Mouse.GetCursorState()
thefiddler [Sat, 10 May 2014 15:54:34 +0000 (17:54 +0200)]
[Mac] Implemented Mouse.GetCursorState()

10 years ago[Examples] Test Mouse.SetPosition
thefiddler [Sat, 10 May 2014 00:12:52 +0000 (02:12 +0200)]
[Examples] Test Mouse.SetPosition

10 years ago[SDL] Use h-wheel events
thefiddler [Sat, 10 May 2014 00:06:40 +0000 (02:06 +0200)]
[SDL] Use h-wheel events

10 years ago[Input] Improve SDL2 and Windows GetCursorState
thefiddler [Fri, 9 May 2014 23:44:27 +0000 (01:44 +0200)]
[Input] Improve SDL2 and Windows GetCursorState

10 years ago[Input] Added Mouse.GetCursorPos() (WIP)
thefiddler [Fri, 9 May 2014 23:30:46 +0000 (01:30 +0200)]
[Input] Added Mouse.GetCursorPos() (WIP)

10 years agoMerge pull request #114 from thefiddler/nativewindow
thefiddler [Mon, 12 May 2014 00:20:29 +0000 (02:20 +0200)]
Merge pull request #114 from thefiddler/nativewindow

INativeWindow cleanup and consolidation

10 years ago[Examples] Fixed Scroll.X/Y misreporting
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.

10 years ago[Platform] Fixed keys getting stuck on focus loss
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.

10 years ago[Win] Fixed infinite recursion
thefiddler [Fri, 9 May 2014 14:14:13 +0000 (16:14 +0200)]
[Win] Fixed infinite recursion

10 years ago[Graphics] Made entry points internal
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.

10 years ago[Input] Do not hook FocusedChanged
thefiddler [Fri, 9 May 2014 13:23:39 +0000 (15:23 +0200)]
[Input] Do not hook FocusedChanged

This is handled by NativeWindowBase now.

10 years ago[Win] Cleaned up window size/pos properties
thefiddler [Fri, 9 May 2014 13:22:33 +0000 (15:22 +0200)]
[Win] Cleaned up window size/pos properties

10 years ago[X11] Fixed WindowBorder and WindowState setters
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!

10 years ago[Platform] Raise KeyUp events on focus lost
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.

10 years ago[X11] Fixed key repeat
thefiddler [Thu, 8 May 2014 22:26:51 +0000 (00:26 +0200)]
[X11] Fixed key repeat

10 years ago[X11] Improved vsync support
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.

10 years ago[X11] Corrected size events
thefiddler [Thu, 8 May 2014 18:58:11 +0000 (20:58 +0200)]
[X11] Corrected size events

10 years agoMerge pull request #113 from danzel/develop
thefiddler [Wed, 7 May 2014 22:51:32 +0000 (00:51 +0200)]
Merge pull request #113 from danzel/develop

[Platform] Correct spelling in INativeWindow

10 years agoCorrect spelling in INativeWindow
Dave Leaver [Wed, 7 May 2014 22:21:27 +0000 (10:21 +1200)]
Correct spelling in INativeWindow

10 years ago[GL] Added generic RenderbufferStorage depth-stencil formats
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.

10 years agoMerge pull request #111 from thefiddler/sdl_stack_fix
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

10 years ago[SDL] Avoid CursorVisible = true cursor jump
thefiddler [Tue, 6 May 2014 07:36:30 +0000 (09:36 +0200)]
[SDL] Avoid CursorVisible = true cursor jump

10 years ago[SDL] Report mouse in client coordinates
thefiddler [Tue, 6 May 2014 07:31:35 +0000 (09:31 +0200)]
[SDL] Report mouse in client coordinates

10 years ago[Examples] Test MouseCursor in GameWindowStates
thefiddler [Tue, 6 May 2014 07:12:08 +0000 (09:12 +0200)]
[Examples] Test MouseCursor in GameWindowStates

10 years ago[Mac] Fixed PointTo* calculations
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.

10 years ago[Platform] Forward PointToScreen to backend
thefiddler [Tue, 6 May 2014 07:02:09 +0000 (09:02 +0200)]
[Platform] Forward PointToScreen to backend

10 years ago[Platform] More selective mouse events
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.

10 years ago[Examples] Added PointToClient test
thefiddler [Tue, 6 May 2014 07:00:42 +0000 (09:00 +0200)]
[Examples] Added PointToClient test

10 years ago[SDL] Improved documentation of Event size hack
thefiddler [Mon, 5 May 2014 13:11:01 +0000 (15:11 +0200)]
[SDL] Improved documentation of Event size hack

10 years ago[SDL] Fixed a stack corruption issue on win32
Stefanos A [Mon, 5 May 2014 10:46:48 +0000 (12:46 +0200)]
[SDL] Fixed a stack corruption issue on win32

10 years ago[Mac] Report KeyDown/Up events for modifier flags
thefiddler [Mon, 5 May 2014 07:14:14 +0000 (09:14 +0200)]
[Mac] Report KeyDown/Up events for modifier flags

10 years ago[Examples] Print KeyboardState
thefiddler [Sun, 4 May 2014 22:56:19 +0000 (00:56 +0200)]
[Examples] Print KeyboardState

10 years ago[Examples] Test key events for consistency
thefiddler [Sun, 4 May 2014 22:43:58 +0000 (00:43 +0200)]
[Examples] Test key events for consistency

10 years ago[Input] Implement key repeat
thefiddler [Sun, 4 May 2014 22:43:45 +0000 (00:43 +0200)]
[Input] Implement key repeat

10 years ago[OpenTK] Refactor keyboard and mouse handling
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.

10 years ago[X11] Added X11KeyMap.TranslateButton()
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.

10 years ago[Mac] Moved MacOSKeys to MacOS namespace
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

10 years ago[Input] Update state through HandleKey* events
thefiddler [Sun, 4 May 2014 15:02:00 +0000 (17:02 +0200)]
[Input] Update state through HandleKey* events

10 years ago[Input] Removed pointless unsafe region
thefiddler [Sun, 4 May 2014 15:01:34 +0000 (17:01 +0200)]
[Input] Removed pointless unsafe region

10 years ago[Input] Removed pointless ValuePrecise setter
thefiddler [Sun, 4 May 2014 14:58:59 +0000 (16:58 +0200)]
[Input] Removed pointless ValuePrecise setter

10 years ago[Input] Removed pointless MouseDevice.SetState
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.

10 years ago[Mac] Add horizontal scrolling
thefiddler [Sun, 4 May 2014 13:24:02 +0000 (15:24 +0200)]
[Mac] Add horizontal scrolling

10 years ago[OpenTK] Raise NativeWindow.Mouse* events
thefiddler [Sun, 4 May 2014 13:23:40 +0000 (15:23 +0200)]
[OpenTK] Raise NativeWindow.Mouse* events

10 years ago[Mac] Disable momentum scrolling and key pop-ups
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.

10 years ago[Platform] Remove lambdas
thefiddler [Sun, 4 May 2014 06:34:13 +0000 (08:34 +0200)]
[Platform] Remove lambdas

10 years ago[Examples] Hook both MouseDevice and Mouse events
thefiddler [Sun, 4 May 2014 06:33:51 +0000 (08:33 +0200)]
[Examples] Hook both MouseDevice and Mouse events

They should give identical results.

10 years ago[Input] MouseDevice is now based on MouseState
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.

10 years ago[Mac] Avoid calling into LegacyInputDriver
thefiddler [Sun, 4 May 2014 06:32:26 +0000 (08:32 +0200)]
[Mac] Avoid calling into LegacyInputDriver

10 years ago[X11] Removed legacy X11Input driver
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.

10 years ago[Input] Improved MouseState.ToString()
thefiddler [Sun, 4 May 2014 06:31:11 +0000 (08:31 +0200)]
[Input] Improved MouseState.ToString()

10 years ago[Platform] Improved mouse interface
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.

10 years ago[Platform] Added support for horizontal wheel
thefiddler [Sat, 3 May 2014 14:47:03 +0000 (16:47 +0200)]
[Platform] Added support for horizontal wheel

10 years ago[SDL] Corrected SDL_Mouse* event structs
thefiddler [Fri, 2 May 2014 15:39:00 +0000 (17:39 +0200)]
[SDL] Corrected SDL_Mouse* event structs

10 years ago[Platform] Refactored INativeWindow backends
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.

10 years ago[Mac] Fixed initial window position
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.

10 years ago[Mac] Fixed cursor coords when CursorVisible=false
thefiddler [Fri, 2 May 2014 12:21:32 +0000 (14:21 +0200)]
[Mac] Fixed cursor coords when CursorVisible=false

10 years ago[Platform] Added INativeWindow.Mouse* events
thefiddler [Fri, 2 May 2014 12:18:52 +0000 (14:18 +0200)]
[Platform] Added INativeWindow.Mouse* events

10 years ago[Platform] Inherit NativeWindowBase
thefiddler [Fri, 2 May 2014 12:18:40 +0000 (14:18 +0200)]
[Platform] Inherit NativeWindowBase

10 years ago[Mac] Use On* methods from base class
thefiddler [Sun, 27 Apr 2014 07:39:30 +0000 (09:39 +0200)]
[Mac] Use On* methods from base class

10 years ago[OpenTK] Add On* methods to raise events
thefiddler [Sun, 27 Apr 2014 07:39:18 +0000 (09:39 +0200)]
[OpenTK] Add On* methods to raise events

10 years ago[Input] Added internal MouseDevice.Position getter
thefiddler [Sun, 27 Apr 2014 07:38:55 +0000 (09:38 +0200)]
[Input] Added internal MouseDevice.Position getter

10 years ago[Mac] Inherit from NativeWindowBase
thefiddler [Sun, 27 Apr 2014 07:21:33 +0000 (09:21 +0200)]
[Mac] Inherit from NativeWindowBase

This reduces code duplication significantly.

10 years ago[OpenTK] Added NativeWindowBase
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.

10 years ago[Examples] Use Key.Enter to capture mouse
thefiddler [Thu, 1 May 2014 21:56:25 +0000 (23:56 +0200)]
[Examples] Use Key.Enter to capture mouse

10 years ago[Examples] Fixed cursor hotspot
thefiddler [Thu, 1 May 2014 20:17:06 +0000 (22:17 +0200)]
[Examples] Fixed cursor hotspot

10 years ago[Examples] Improved MouseCursor example
thefiddler [Thu, 1 May 2014 15:03:47 +0000 (17:03 +0200)]
[Examples] Improved MouseCursor example

10 years ago[Win] Only set MouseCursor in client area
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.

10 years ago[SDL][Win] Destroy custom cursor on Close()
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.

10 years ago[OpenTK] Rearranged MouseCursor parameters
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.

10 years ago[SDL] Fixed MouseCursor getting stuck after multiple changes
thefiddler [Wed, 30 Apr 2014 11:46:44 +0000 (13:46 +0200)]
[SDL] Fixed MouseCursor getting stuck after multiple changes

10 years ago[SDL] Fixed custom MouseCursor
thefiddler [Wed, 30 Apr 2014 11:36:16 +0000 (13:36 +0200)]
[SDL] Fixed custom MouseCursor

10 years ago[Example] Test custom cursor
thefiddler [Wed, 30 Apr 2014 07:06:30 +0000 (09:06 +0200)]
[Example] Test custom cursor

10 years ago[Mac] Fixed cursor byte order
thefiddler [Wed, 30 Apr 2014 07:06:18 +0000 (09:06 +0200)]
[Mac] Fixed cursor byte order

10 years ago[OpenTK] Fixed compilation error
thefiddler [Wed, 30 Apr 2014 06:45:27 +0000 (08:45 +0200)]
[OpenTK] Fixed compilation error

10 years ago[OpenTK] Renamed x/y to hotx/hoty
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.

10 years ago[Platform] Renamed MouseCursor.Rgba to Argb
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.

10 years ago[Mac] Implement NSCursor rectangles
thefiddler [Wed, 30 Apr 2014 06:38:19 +0000 (08:38 +0200)]
[Mac] Implement NSCursor rectangles

10 years ago[Platform] Make MouseCursor actor public
thefiddler [Wed, 30 Apr 2014 06:37:34 +0000 (08:37 +0200)]
[Platform] Make MouseCursor actor public

10 years ago[Win] Log wglSwapIntervalEXT errors
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.

10 years ago[OpenTK] Query the driver for VSyncMode getter
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.

10 years ago[All] Fixed checks for EXT_swap_control_tear
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.