platform/core/csapi/opentk.git
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.

10 years ago[Mac] Removed unused CarbonGLNative.cs
thefiddler [Mon, 28 Apr 2014 15:17:34 +0000 (17:17 +0200)]
[Mac] Removed unused CarbonGLNative.cs

10 years ago[Mac] Remove call to NewEventHandlerUPP
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.

10 years ago[Mac] CGDisplayBounds signature now matches Mac ABI
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.

10 years agoMerge branch 'pr/105' into develop
thefiddler [Mon, 28 Apr 2014 14:19:17 +0000 (16:19 +0200)]
Merge branch 'pr/105' into develop

10 years ago[Mac] Cmd-Q should raise Closing events
thefiddler [Mon, 28 Apr 2014 14:19:04 +0000 (16:19 +0200)]
[Mac] Cmd-Q should raise Closing events

It should also be cancelable.

10 years agoMerge branch 'thefiddler-cursor' into develop
thefiddler [Mon, 28 Apr 2014 07:38:54 +0000 (09:38 +0200)]
Merge branch 'thefiddler-cursor' into develop

10 years ago[Win] Fixed MouseCursor.Default
thefiddler [Mon, 28 Apr 2014 07:37:16 +0000 (09:37 +0200)]
[Win] Fixed MouseCursor.Default

It is now possible to switch from a custom cursor back to
MouseCursor.Default.

10 years agoMerge branch 'cursor' of https://github.com/thefiddler/opentk into thefiddler-cursor
thefiddler [Mon, 28 Apr 2014 05:07:47 +0000 (07:07 +0200)]
Merge branch 'cursor' of https://github.com/thefiddler/opentk into thefiddler-cursor

10 years ago[X11] Fixed SGI_swap_control query
thefiddler [Sun, 27 Apr 2014 23:29:34 +0000 (01:29 +0200)]
[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.

10 years ago[GL] Added GetPName.Max*ImageUniforms
thefiddler [Sun, 27 Apr 2014 20:47:04 +0000 (22:47 +0200)]
[GL] Added GetPName.Max*ImageUniforms

These tokens were introduced in OpenGL 4.2 and 4.3.

10 years ago[OpenTK] Only init X11 if SDL2 is not used
thefiddler [Sun, 27 Apr 2014 20:41:24 +0000 (22:41 +0200)]
[OpenTK] Only init X11 if SDL2 is not used

10 years ago[X11] Fixed INativeWindow.Cursor getter
thefiddler [Sun, 27 Apr 2014 20:28:10 +0000 (22:28 +0200)]
[X11] Fixed INativeWindow.Cursor getter

10 years ago[Input] Fixed key modifiers in KeyboardDevice events
thefiddler [Sun, 27 Apr 2014 20:27:18 +0000 (22:27 +0200)]
[Input] Fixed key modifiers in KeyboardDevice events

10 years ago[SDL] Fixed cursor support
thefiddler [Sun, 27 Apr 2014 19:09:51 +0000 (21:09 +0200)]
[SDL] Fixed cursor support

SDL.CreateColorCursor takes 3 arguments, not 5.

10 years ago[Mac] Implement INativeWindow.Cursor
thefiddler [Sun, 27 Apr 2014 17:45:20 +0000 (19:45 +0200)]
[Mac] Implement INativeWindow.Cursor

10 years ago[OpenTK] Treat null as MouseCursor.Empty
thefiddler [Sun, 27 Apr 2014 17:45:08 +0000 (19:45 +0200)]
[OpenTK] Treat null as MouseCursor.Empty

10 years ago[OpenTK] Disable custom MouseCursors
thefiddler [Sun, 27 Apr 2014 17:44:45 +0000 (19:44 +0200)]
[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.

10 years ago[Examples] Set a predefined cursor on Key.Space
thefiddler [Sun, 27 Apr 2014 17:43:16 +0000 (19:43 +0200)]
[Examples] Set a predefined cursor on Key.Space

Custom cursor are not enabled for OpenTK 1.1.2. They will be part of
OpenTK 1.1.3.

10 years ago[Mac] Stubbed INativeWindow.Cursor
thefiddler [Sun, 27 Apr 2014 08:56:08 +0000 (10:56 +0200)]
[Mac] Stubbed INativeWindow.Cursor

10 years agoFix a bug in X11 CursorVisble with custom cursors.
Fraser Waters [Mon, 24 Feb 2014 12:58:41 +0000 (12:58 +0000)]
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).

10 years agoChange bool to IntPtr.
Fraser Waters [Sat, 22 Feb 2014 14:08:18 +0000 (14:08 +0000)]
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.