Commit graph

444 commits

Author SHA1 Message Date
thefiddler 6f6798de62 [KMS] Added new Linux KMS driver 2014-07-16 14:28:27 +02:00
thefiddler f0fd13a23e Merge pull request #138 from thefiddler/xi2exitfix
[X11] Fix hang when exiting XI2 input thread
2014-06-18 10:26:06 +02:00
thefiddler f889835dd5 Merge pull request #135 from thefiddler/xquartz
XQuartz support (X11 on Mac)
2014-06-17 09:06:05 +02:00
thefiddler ea5f1ad1e8 [X11] Send ClientMessage to exit input event loop
To do that, we need a custom InputOnly window. This window is only used
for receiving the exit ClientMessage - XI2 input is still received
through the root window.

Fixes issue https://github.com/mono/MonoGame/issues/2711
2014-06-17 09:05:29 +02:00
thefiddler 7accefea3e [X11] Remove unused XCreateWindow overloads 2014-06-17 08:51:00 +02:00
thefiddler 9d840e5969 [X11] Added glXQueryVersion DllImport. 2014-06-15 14:30:40 +02:00
thefiddler 9075129df0 [X11] Throw exception if GLX is not supported
You cannot create an X11/OpenGL context without the GLX extension.
OpenTK will now throw a `NotSupportedException` when this condition is
encountered.

In some cases, it may be possible to enable the EGL backend by passing
`GraphicsContextFlags.Embedded` to the `GraphicsContext` constructor.
2014-06-15 14:30:23 +02:00
thefiddler c657b3d11e [X11] Check before monitoring /dev/input
This avoids a crash on non-Linux systems that do not support /dev/input.
2014-06-15 14:29:07 +02:00
thefiddler 525af589f1 [X11] Match win32 wheel coordinate system
OpenTK uses the win32 wheel coordinate system, where
(+h, +v) = (right, up). XI2 uses (+h, +v) = (right, down)
instead, so we need to flip the vertical offset.

Fixes issue #133 and https://github.com/mono/MonoGame/issues/2686
2014-06-10 14:53:23 +02:00
thefiddler ea0ab3243e Merge pull request #123 from thefiddler/eglfix
[EGL] Fix initialization and extension loading
2014-05-19 23:14:41 +02:00
thefiddler ec31675fc8 [X11] Fixed BadWindow error on shutdown
This was caused by calling XDestroyWindow inside Dispose(), or
by processing events after calling XDestroyWindow. Pending events
are now discarded when Close() is called and not cancelled, and
XDestroyWindow is only called if the window exists.
2014-05-19 22:02:46 +02:00
thefiddler fd3ac1e4cc Removed file committed by mistake 2014-05-19 12:34:09 +02:00
thefiddler ade8e61625 Merge branch 'xkeyfix' of https://github.com/thefiddler/opentk into develop 2014-05-19 10:52:37 +02:00
thefiddler cfb2d45b8b [X11] Improved WindowBorder.Fixed detection
This now works even without having to map the window first.
2014-05-19 09:22:27 +02:00
thefiddler d483b01de0 [EGL] Fixed display connection
We now use the display connection specified in EglWindowInfo
throughout the EGL backend, instead of opening new connections
in EglGraphicsMode. This fixes EGL errors in
Egl.CreateWindowSurface.

As part of this fix, all instances of
IPlatformFactory.CreateGraphicsMode() have been removed. This
API is no longer used in OpenTK 1.1
2014-05-19 08:31:38 +02:00
thefiddler 97b211a101 [EGL] Egl.GetProcAddress only returns extensions
We have to load statically exported entry points using the regular OS
symbol loading facilities, and only use eglGetProcAddress for
extensions.

Fixes crash in https://github.com/mono/MonoGame/pull/2377
2014-05-18 22:04:52 +02:00
thefiddler 4ede3ad2d0 [X11] Renamed XI2Mouse
This file now implements both mouse and keyboard input, so its name
has been updated to reflect that.
2014-05-15 10:24:03 +02:00
thefiddler b4f4be7ece [X11] Split X11 and XI2 input drivers 2014-05-15 10:22:01 +02:00
thefiddler 7d1bec58cc [X11] Implemented XI2 keyboard input 2014-05-15 10:21:06 +02:00
thefiddler 2eb88d9788 [X11] Added XIDeviceType enumeration 2014-05-15 10:20:23 +02:00
thefiddler 692c4c64ff [X11] Rebased on develop branch 2014-05-15 01:16:28 +02:00
thefiddler 7cce215a4b [X11] Use XKB for layout-independent input
The code will fall back to core X11 if XKB is not available.
2014-05-15 01:13:12 +02:00
thefiddler e8176ef7cf [X11] Added XKB bindings 2014-05-15 01:12:06 +02:00
thefiddler 1690cf859e [X11] Removed unused SetCursor() function 2014-05-14 00:42:05 +02:00
thefiddler a062d4c0a7 [X11] Removed stale comment 2014-05-14 00:00:13 +02:00
thefiddler 30d7780f1e [X11] Removed unused warp detection code 2014-05-13 23:51:55 +02:00
thefiddler dd16142a3a [X11] Fixed GetCursorState() after SetPosition()
The new position is now immediately reflected in GetCursorPos().
2014-05-13 23:50:39 +02:00
thefiddler 452d61bc60 [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.
2014-05-13 23:34:27 +02:00
thefiddler c6dafbccba [X11] Implemented high-resolution scroll events 2014-05-13 23:23:51 +02:00
thefiddler a30af547f9 [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.
2014-05-13 22:31:45 +02:00
thefiddler 7e3b99c636 [X11] Fixed cursor position when CursorVisible becomes true 2014-05-13 13:23:20 +02:00
thefiddler fc718026fd [X11] Fixed Cursor when CursorVisible = false
Setting Cursor will no longer override CursorVisible.
2014-05-13 09:27:21 +02:00
thefiddler c2bd8624b5 Merge branch 'nvidiafix' into develop 2014-05-12 17:00:42 +02:00
thefiddler 4e8786f123 [X11] Correct Glx.*.SwapInterval definitions
Improved error checking means we are no longer crashing when
SwapInterval is not available.
2014-05-12 14:50:03 +02:00
thefiddler 88905cb6aa [X11] Fixed GLX extension loading
GLX is now using the new extension loading mechanism,
and the entry point names now much the available slots.
2014-05-12 13:59:48 +02:00
thefiddler bd712e4775 [X11] Flush XSendEvent on exit 2014-05-12 02:20:53 +02:00
thefiddler 1cf7386748 [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.
2014-05-12 02:20:53 +02:00
thefiddler bba9c8c26f [X11] Improved XI2Mouse implementation
Horizontal and vertical smooth scrolling is now supported.
Movement axes are now correctly identified. Device hotplugging
has been improved.
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 f0d0f6e53a [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!
2014-05-09 13:10:23 +02:00
thefiddler 86146f54d5 [X11] Fixed key repeat 2014-05-09 00:26:51 +02:00
thefiddler 8195800ee7 [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.
2014-05-09 00:13:23 +02:00
thefiddler d430b462fe [X11] Corrected size events 2014-05-08 20:58:11 +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 e155d647de [X11] Added X11KeyMap.TranslateButton()
This code was duplicated on four different places before.
2014-05-04 17:04:03 +02:00
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 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